(ns
 shen
 (:refer-clojure :only [])
 (:use [shen.primitives] [clojure.tools.trace])
 (:require [clojure.core :as cl] [clojure.walk :as walk])
 (:gen-class))

(clojure.core/declare
 shen-udefs*
 step
 shen-decons
 shen-head_abstraction
 track
 subst
 shen-<literal*>
 sum
 shen-lzy=
 shen-split_cc_rules
 external
 shen-let-macro
 shen-mu_reduction
 shen-prolog-form
 shen-<rcurly>
 shen-csl-help
 input+
 ==
 shen-intprolog-help
 shen-<alpha>
 __at__s
 shen-compile_to_kl
 write-to-file
 FORMAT
 input
 shen-<blah>
 shen-lzy=!
 shen-default_semantics
 format
 tuple?
 shen-list_stream?
 shen-<type>
 adjoin
 fwhen
 shen-mk-pvar
 gensym
 shen-terminal?
 shen-prolog-failure
 shen-<datatype-rules>
 shen-line
 shen-reassemble
 __at__v
 dump
 mapcan
 <-vector
 shen-<sig+rules>
 shen-<body*>
 shen-typedf?
 shen-datatype-error
 shen-<macrorule>
 shen-get-profile
 shen-<rrb>
 shen-s-prolog_clause
 shen-deref
 shen-post
 shen-normalise-type
 shen-t*-kl_def
 shen-fail_if
 shen-record-source
 shen-rcons_form
 shen-integer-test?
 shen-placeholder-help?
 union
 shen-t*-rules
 findall
 shen-end-of-comment?
 shen-<rule>
 shen-pretty-type
 shen-newcontinuation
 shen-fillvector
 shen-posint?
 shen-jump_stream
 shen-<end*>
 specialise
 shen-flatten
 shen-collect
 shen-vector-macro
 shen-insert_deref
 shen-<pattern>
 shen-make_mu_application
 shen-expt
 shen-right-rule
 shen-unwind-types
 shen-t*-hyps
 shen-insert-prolog-variables
 shen-next-50
 shen-yacc_cases
 shen-<lcurly>
 unprofile
 shen-insert_lazyderef
 shen-th*
 shen-<clause*>
 append
 shen-<str>
 shen-<singleunderline>
 shen-<pattern1>
 shen-prbytes
 shen-normalise-X
 shen-double->singles
 shen-sysfunc?
 shen-package-contents
 shen-length-h
 symbol?
 shen-<side-conditions>
 shen-measure&return
 shen-application_build
 shen-<doubleunderline>
 shen-construct-search-clauses
 shen-toplevel
 shen-catchpoint
 shen-eval-cons
 shen-linearise_help
 shen-shen-syntax-error
 tlv
 shen-initialise-prolog
 shen-mod
 shen-t*-rule
 shen-pvar?
 shen-rules->horn-clauses
 shen-<conclusion>
 shen-complexity_head
 shen-prolog-macro
 shen-+string?
 preclude-all-but
 shen-remove-synonyms
 shen-t*
 shen-case-form
 read
 shen-nl-macro
 shen-retrieve-from-history-if-needed
 shen-mult_subst
 integer?
 shen-errordef
 shen-dh?
 shen-<side-condition>
 shen-<comment>
 shen-show
 shen-free_variable_warnings
 shen-yacc-macro
 shen-form-rule
 fail-if
 shen-abstract_rule
 systemf
 boolean?
 shen-s-prolog
 shen-aum
 shen-<strcontents>
 shen-yacc
 shen-<atom>
 READ-CHAR
 shen-profile-func
 shen-encode-choices
 shen-resize-vector
 print
 shen-reverse_help
 shen-continuation_call
 shen-cond-form
 shen-<plus>
 shen-aritycheck-action
 shen-profile-help
 shen-multiples
 shen-cn-all
 variable?
 shen-cons_form
 shen-embed-and
 shen-pre
 unify
 shen-free_variable_check
 element?
 shen-lineread-kl_loop
 shen-output-track
 shen-call-rest
 shen-<symchar>
 concat
 vector
 shen-cond-expression
 shen-construct-recursive-search-clause
 profile
 shen-print-past-inputs
 shen-<stop>
 include
 shen-construct-search-clause
 cut
 shen-lazyderef
 shen-curry-type
 shen-kl-to-lisp
 shen-make-key
 shen-<predigits>
 assoc
 fix
 shen-<defprolog>
 occurrences
 shen-fix-help
 shen-resizeprocessvector
 occurs-check
 shen-<premises>
 shen-linearise-clause
 shen-dump-target
 shen-copyfromvector
 shen-yacc->shen
 shen-check_stream
 shen-sh?
 shen-<E>
 shen-compile_prolog_procedure
 shen-<name>
 shen-<st_input1>
 shen-<minus>
 vector?
 unspecialise
 shen-abstraction_build
 shen-compile_to_lambda+
 shen-packageh
 map
 shen-<datatype-rule>
 shen-put-profile
 shen-<trule>
 shen-synonyms-help
 shen-jump_stream?
 inferences
 shen-symbol-byte->string
 shen-initialise_environment
 hdv
 shen-magless
 shen-findallhelp
 shen-carriage-return
 arity
 shen-rule->horn-clause
 fst
 shen-first_n
 shen-__at__s-macro
 shen-xmapcan
 destroy
 shen-<sym>
 shen-insert-tracking-code
 shen-t*-ruleh
 shen-input-track
 shen-recursive_descent
 shen-tuple
 call
 shen-exclamation
 shen-prefix?
 shen-type-insecure-rule-error-message
 shen-<digit>
 shen-sys-print
 interror
 shen-load-help
 maxinferences
 shen-read-char
 shen-decimalise
 shen-ob->str
 shen-<bar>
 shen-extract_free_vars
 shen-remtype
 shen-tlv-help
 shen-<strc>
 shen-prolog-aritycheck
 shen-rule->horn-clause-body
 shen-<formulae>
 read-file-as-string
 shen-ephemeral_variable?
 shen-datatype-macro
 shen-cc_body
 shen-walk
 empty?
 shen-right->left
 shen-<head*>
 explode
 shen-t*-patterns
 shen-recursive_cons_form
 shen-catch-cut
 cd
 shen-copy-vector-stage-1
 shen-normalise-type-help
 shen-prolog-error
 shen-credits
 shen-<digits>
 shen-copy-vector
 do
 shen-package-macro
 shen-hat
 shen-percent
 shen-variancy-test
 shen-<comma>
 shen-<guard?>
 shen-update_history
 shen-start-new-prolog-process
 shen-call_the_continuation
 head
 shen-pushnew
 shen-<rsb>
 shen-space
 shen-maxinfexceeded?
 shen-bindv
 shen-<equal>
 shen-f_error
 shen-product
 lineread
 shen-function-abstraction
 shen-legitimate-term?
 shen-left-round
 intersection
 shen-compile-macro
 shen-variant?
 hash
 shen-track-function
 vector->
 stinput
 shen-cf_help
 shen-compile_to_machine_code
 shen-function-abstraction-help
 shen-<trules>
 shen-<sig+rest>
 shen-occurs?
 shen-abs
 shen-<simple_pattern>
 reverse
 shen-<variable?>
 identical
 shen-<pattern2>
 put
 shen-pause-for-user
 hdstr
 shen-<number>
 shen-show-p
 shen-<lrb>
 nth
 shen-by_hypothesis
 shen-placeholders
 shen-insert-prolog-variables-help
 shen-copy-vector-stage-2
 shen-digit-byte?
 shen-<backslash>
 <e>
 shen-timer-macro
 shen-abs-macro
 shen-store-arity
 shen-record-exceptions
 shen-pvar
 load
 shen-cc_help
 shen-<guard>
 shen-lzy==
 shen-blank-fail
 shen-construct-premiss-literal
 spy
 shen-ebr
 shen-procedure_name
 shen-placeholder?
 macroexpand
 shen-<macrorules>
 length
 shen-process-datatype
 shen-remember
 y-or-n?
 return
 shen-__at__v-help
 shen-show-assumptions
 shen-cutpoint
 shen-decons-string
 shen-errormaxinfs
 shen-<semicolon>
 shen-rfas-h
 shen-ms-h
 abort
 read-file-as-bytelist
 tc?
 shen-linearise
 bind
 shen-<semicolon-symbol>
 shen-string->bytes
 include-all-but
 shen-extraspecial?
 difference
 intoutput
 shen-lisp-or
 shen-s-prolog_literal
 shen-doubleunderline?
 shen-placeholder
 shen-change-pointer-value
 shen-aritycheck-name
 shen-remove_modes
 shen-parameters
 nl
 shen-<signature>
 shen-insert_modes
 shen-sigf
 shen-<predicate*>
 shen-kl_loop
 shen-extract_vars
 shen-cases-macro
 shen-left-rule
 shen-err-condition
 compile
 unify!
 shen-toplineread_loop
 shen-construct-search-literals
 shen-<times>
 shen-clauses-to-shen
 shen-write-object-code-to-file
 shen-typecheck
 shen-list_stream
 shen-<any>
 shen-shen->kl
 version
 shen-<dbq>
 shen-<st_input2>
 get
 shen-reduce_help
 shen-vector->list
 shen-extract-pvars
 shen-<postdigits>
 bound?
 shen-nest-disjunct
 shen-incinfs
 intmake-string
 shen-read-file-as-bytelist-help
 shen-<colon>
 shen-read-evaluate-print
 shen-<define>
 shen-defprolog-macro
 shen-explode-string
 shen-<clauses*>
 shen-mode-ify
 shen-call-help
 shen-compress-50
 shen-construct-context
 shen-intprolog
 declare
 shen-typecheck-and-load
 shen-intprolog-help-help
 shen-grammar_symbol?
 shen-+vector?
 shen-linearise_X
 shen-<term*>
 shen-read-error
 preclude
 shen-base
 shen-singleunderline?
 shen-aum_to_shen
 shen-complexity
 shen-shen
 shen-<defmacro>
 shen-newpv
 shen-t*-assume
 shen-<rules>
 shen-multiple-set
 shen-<macroaction>
 shen-shen-out
 shen-<byte>
 shen-compose
 snd
 shen-<whitespace>
 shen-<colonsymbol>
 shen-<patterns>
 shen-after-codepoint
 shen-explicit_modes
 shen-em_help
 ps
 shen-defmacro-macro
 shen-reduce
 shen-prolog->shen
 shen-find
 shen-prolog_constant?
 shen-group_clauses
 shen-modh
 shen-<arrow>
 shen-special?
 shen-<whitespaces>
 shen-valvector
 shen-tuple-up
 shen-snd-or-fail
 shen-<log10>
 shen-construct-side-literals
 shen-remember-datatype
 tc
 shen-assumetype
 eval
 limit
 shen-<symchars>
 shen-tab
 shen-digits->integers
 shen-synonyms-macro
 shen-function-macro
 shen-<expr>
 shen-hush
 shen-terpri-or-read-char
 shen-unbindv
 shen-<digit->string>
 shen-check-byte
 shen-spaces
 shen-<action>
 shen-<signature-help>
 shen-m_prolog_to_s-prolog_predicate
 shen-<lsb>
 shen-toplevel_evaluate
 shen-conc
 shen-typecheck-and-evaluate
 shen-toplineread
 __at__p
 shen-aritycheck
 tail
 shen-recursively-print
 shen-<premise>
 shen-construct-base-search-clause
 shen-split_cc_rule
 shen-rule->horn-clause-head
 fail
 remove
 shen-prompt
 shen-control-chars
 shen-chwild
 read-file
 shen-aah
 shen-trim-gubbins
 shen-sys-error
 shen-remove-bar
 shen-initialise_arity_table
 shen-tracked?
 shen-read-char-h
 shen-semantics
 not
 shen-byte->digit
 shen-packaged?
 shen-code-point
 shen-add_test
 shen-newline
 profile-results
 shen-curry
 shen-assoc-macro
 shen-find-past-inputs
 shen-<formula>
 shen-syntax
 shen-+vector
 shen-compile-error
 untrack
 shen-list_variables
 shen-succeeds?
 shen-insert-predicate
 shen-typetable
 shen-same_predicate?
 shen-clause_form
 shen-<st_input>)

(clojure.core/comment "klambda/sys.kl")

(defun
 eval
 (V629)
 (let
  Macroexpand
  (shen-walk (lambda V630 (macroexpand V630)) V629)
  (if
   (shen-packaged? Macroexpand)
   (map
    (lambda V631 (eval-without-macros V631))
    (shen-package-contents Macroexpand))
   (eval-without-macros Macroexpand))))

(defun
 shen-packaged?
 (V638)
 (cond
  ((and
    (cons? V638)
    (and
     (= 'package (hd V638))
     (and (cons? (tl V638)) (cons? (tl (tl V638))))))
   true)
  (true false)))

(defun
 external
 (V639)
 (trap-error
  (get V639 'shen-external-symbols (value 'shen-*property-vector*))
  (lambda E (interror "package ~A has not been used.~" ()))))

(defun
 shen-package-contents
 (V642)
 (cond
  ((and
    (cons? V642)
    (and
     (= 'package (hd V642))
     (and
      (cons? (tl V642))
      (and (= 'null (hd (tl V642))) (cons? (tl (tl V642)))))))
   (tl (tl (tl V642))))
  ((and
    (cons? V642)
    (and
     (= 'package (hd V642))
     (and (cons? (tl V642)) (cons? (tl (tl V642))))))
   (shen-packageh (hd (tl V642)) (hd (tl (tl V642))) 'Code))
  (true (shen-sys-error 'shen-package-contents))))

(defun
 shen-walk
 (V643 V644)
 (cond
  ((cons? V644)
   ((function V643) (map (lambda Z (shen-walk V643 Z)) V644)))
  (true ((function V643) V644))))

(defun
 compile
 (V645 V646 V647)
 (let
  O
  ((function V645) (__at__p V646 ()))
  (if
   (or (= (fail) O) (not (empty? (fst O))))
   (shen-compile-error O V647)
   (snd O))))

(defun
 shen-compile-error
 (V660 V661)
 (cond
  ((= () V661) (fail))
  ((and (tuple? V660) (cons? (fst V660))) ((function V661) (fst V660)))
  (true (interror "syntax error~%" ()))))

(defun
 <e>
 (V666)
 (cond
  ((tuple? V666) (__at__p (fst V666) ()))
  (true (shen-sys-error '<e>))))

(defun fail-if (V667 V668) (if ((function V667) V668) (fail) V668))

(defun __at__s (V669 V670) (cn V669 V670))

(defun tc? (V675) (value 'shen-*tc*))

(defun
 ps
 (V676)
 (trap-error
  (get V676 'shen-source (value 'shen-*property-vector*))
  (lambda E (interror "~A not found.~%" (__at__p V676 ())))))

(defun
 explode
 (V677)
 (if
  (string? V677)
  (shen-explode-string V677)
  (recur (intmake-string "~A" (__at__p V677 ())))))

(defun
 shen-explode-string
 (V678)
 (cond
  ((= "" V678) ())
  (true
   (let
    S
    (pos V678 0)
    (let
     Ss
     (tlstr V678)
     (if (= Ss 'shen-eos) () (cons S (shen-explode-string Ss))))))))

(defun stinput (V683) (value '*stinput*))

(defun
 shen-+vector?
 (V684)
 (and (absvector? V684) (> (<-address V684 0) 0)))

(defun
 vector
 (V685)
 (let Vector (absvector (+ V685 1)) (address-> Vector 0 V685)))

(defun
 shen-fillvector
 (V688 V689 V690 V691)
 (cond
  ((= V690 V689) V688)
  (true (recur (address-> V688 V689 V691) (+ 1 V689) V690 V691))))

(defun
 vector?
 (V693)
 (and
  (absvector? V693)
  (trap-error (>= (<-address V693 0) 0) (lambda E false))))

(defun
 vector->
 (V694 V695 V696)
 (if
  (= V695 0)
  (interror "cannot access 0th element of a vector~%" ())
  (address-> V694 V695 V696)))

(defun
 <-vector
 (V697 V698)
 (if
  (= V698 0)
  (interror "cannot access 0th element of a vector~%" ())
  (let
   VectorElement
   (<-address V697 V698)
   (if
    (= VectorElement (fail))
    (interror "vector element not found~%" ())
    VectorElement))))

(defun shen-posint? (V699) (and (integer? V699) (>= V699 0)))

(defun limit (V700) (<-address V700 0))

(defun
 symbol?
 (V701)
 (cond
  ((or (boolean? V701) (number? V701)) false)
  (true
   (trap-error
    (let
     String
     (str V701)
     (let
      Unit
      (pos String 0)
      (element?
       Unit
       (cons
        "A"
        (cons
         "B"
         (cons
          "C"
          (cons
           "D"
           (cons
            "E"
            (cons
             "F"
             (cons
              "G"
              (cons
               "H"
               (cons
                "I"
                (cons
                 "J"
                 (cons
                  "K"
                  (cons
                   "L"
                   (cons
                    "M"
                    (cons
                     "N"
                     (cons
                      "O"
                      (cons
                       "P"
                       (cons
                        "Q"
                        (cons
                         "R"
                         (cons
                          "S"
                          (cons
                           "T"
                           (cons
                            "U"
                            (cons
                             "V"
                             (cons
                              "W"
                              (cons
                               "X"
                               (cons
                                "Y"
                                (cons
                                 "Z"
                                 (cons
                                  "a"
                                  (cons
                                   "b"
                                   (cons
                                    "c"
                                    (cons
                                     "d"
                                     (cons
                                      "e"
                                      (cons
                                       "f"
                                       (cons
                                        "g"
                                        (cons
                                         "h"
                                         (cons
                                          "i"
                                          (cons
                                           "j"
                                           (cons
                                            "k"
                                            (cons
                                             "l"
                                             (cons
                                              "m"
                                              (cons
                                               "n"
                                               (cons
                                                "o"
                                                (cons
                                                 "p"
                                                 (cons
                                                  "q"
                                                  (cons
                                                   "r"
                                                   (cons
                                                    "s"
                                                    (cons
                                                     "t"
                                                     (cons
                                                      "u"
                                                      (cons
                                                       "v"
                                                       (cons
                                                        "w"
                                                        (cons
                                                         "x"
                                                         (cons
                                                          "y"
                                                          (cons
                                                           "z"
                                                           (cons
                                                            "="
                                                            (cons
                                                             "*"
                                                             (cons
                                                              "/"
                                                              (cons
                                                               "+"
                                                               (cons
                                                                "-"
                                                                (cons
                                                                 "_"
                                                                 (cons
                                                                  "?"
                                                                  (cons
                                                                   "$"
                                                                   (cons
                                                                    "!"
                                                                    (cons
                                                                     "__at__"
                                                                     (cons
                                                                      "~"
                                                                      (cons
                                                                       ">"
                                                                       (cons
                                                                        "<"
                                                                        (cons
                                                                         "&"
                                                                         (cons
                                                                          "%"
                                                                          (cons
                                                                           "{"
                                                                           (cons
                                                                            "}"
                                                                            (cons
                                                                             ":"
                                                                             (cons
                                                                              ";"
                                                                              ()))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
    (lambda E false)))))

(defun
 variable?
 (V702)
 (trap-error
  (let
   String
   (str V702)
   (let
    Unit
    (pos String 0)
    (element?
     Unit
     (cons
      "A"
      (cons
       "B"
       (cons
        "C"
        (cons
         "D"
         (cons
          "E"
          (cons
           "F"
           (cons
            "G"
            (cons
             "H"
             (cons
              "I"
              (cons
               "J"
               (cons
                "K"
                (cons
                 "L"
                 (cons
                  "M"
                  (cons
                   "N"
                   (cons
                    "O"
                    (cons
                     "P"
                     (cons
                      "Q"
                      (cons
                       "R"
                       (cons
                        "S"
                        (cons
                         "T"
                         (cons
                          "U"
                          (cons
                           "V"
                           (cons
                            "W"
                            (cons
                             "X"
                             (cons
                              "Y"
                              (cons "Z" ())))))))))))))))))))))))))))))
  (lambda E false)))

(defun
 gensym
 (V703)
 (concat V703 (set 'shen-*gensym* (+ 1 (value 'shen-*gensym*)))))

(defun concat (V704 V705) (intern (cn (str V704) (str V705))))

(defun
 __at__p
 (V706 V707)
 (let
  Vector
  (absvector 3)
  (let
   Tag
   (address-> Vector 0 'shen-tuple)
   (let
    Fst
    (address-> Vector 1 V706)
    (let Snd (address-> Vector 2 V707) Vector)))))

(defun fst (V708) (<-address V708 1))

(defun snd (V709) (<-address V709 2))

(defun
 tuple?
 (V710)
 (trap-error
  (and (absvector? V710) (= 'shen-tuple (<-address V710 0)))
  (lambda E false)))

(defun
 append
 (V711 V712)
 (cond
  ((= () V711) V712)
  ((cons? V711) (cons (hd V711) (append (tl V711) V712)))
  (true (shen-sys-error 'append))))

(defun
 __at__v
 (V713 V714)
 (let
  Limit
  (limit V714)
  (let
   NewVector
   (vector (+ Limit 1))
   (let
    X+NewVector
    (vector-> NewVector 1 V713)
    (if
     (= Limit 0)
     X+NewVector
     (shen-__at__v-help V714 1 Limit X+NewVector))))))

(defun
 shen-__at__v-help
 (V715 V716 V717 V718)
 (cond
  ((= V717 V716) (shen-copyfromvector V715 V718 V717 (+ V717 1)))
  (true
   (recur
    V715
    (+ V716 1)
    V717
    (shen-copyfromvector V715 V718 V716 (+ V716 1))))))

(defun
 shen-copyfromvector
 (V720 V721 V722 V723)
 (trap-error
  (vector-> V721 V723 (<-vector V720 V722))
  (lambda E V721)))

(defun
 hdv
 (V724)
 (trap-error
  (<-vector V724 1)
  (lambda
   E
   (interror
    "hdv needs a non-empty vector as an argument; not ~S~%"
    (__at__p V724 ())))))

(defun
 tlv
 (V725)
 (let
  Limit
  (limit V725)
  (if
   (= Limit 0)
   (interror "cannot take the tail of the empty vector~%" ())
   (if
    (= Limit 1)
    (vector 0)
    (let
     NewVector
     (vector (- Limit 1))
     (shen-tlv-help V725 2 Limit (vector (- Limit 1))))))))

(defun
 shen-tlv-help
 (V726 V727 V728 V729)
 (cond
  ((= V728 V727) (shen-copyfromvector V726 V729 V728 (- V728 1)))
  (true
   (recur
    V726
    (+ V727 1)
    V728
    (shen-copyfromvector V726 V729 V727 (- V727 1))))))

(defun
 assoc
 (V739 V740)
 (cond
  ((= () V740) ())
  ((and (cons? V740) (and (cons? (hd V740)) (= (hd (hd V740)) V739)))
   (hd V740))
  ((cons? V740) (recur V739 (tl V740)))
  (true (shen-sys-error 'assoc))))

(defun
 boolean?
 (V746)
 (cond ((= true V746) true) ((= false V746) true) (true false)))

(defun
 nl
 (V747)
 (cond ((= 0 V747) 0) (true (do (intoutput "~%" ()) (nl (- V747 1))))))

(defun
 difference
 (V750 V751)
 (cond
  ((= () V750) ())
  ((cons? V750)
   (if
    (element? (hd V750) V751)
    (difference (tl V750) V751)
    (cons (hd V750) (difference (tl V750) V751))))
  (true (shen-sys-error 'difference))))

(defun do (V752 V753) V753)

(defun
 element?
 (V762 V763)
 (cond
  ((= () V763) false)
  ((and (cons? V763) (= (hd V763) V762)) true)
  ((cons? V763) (recur V762 (tl V763)))
  (true (shen-sys-error 'element?))))

(defun empty? (V769) (cond ((= () V769) true) (true false)))

(defun
 fix
 (V770 V771)
 (shen-fix-help V770 V771 ((function V770) V771)))

(defun
 shen-fix-help
 (V778 V779 V780)
 (cond
  ((= V780 V779) V780)
  (true (recur V778 V780 ((function V778) V780)))))

(defun
 put
 (V782 V783 V784 V785)
 (let
  N
  (hash V782 (limit V785))
  (let
   Entry
   (trap-error (<-vector V785 N) (lambda E ()))
   (let
    Change
    (vector-> V785 N (shen-change-pointer-value V782 V783 V784 Entry))
    V784))))

(defun
 shen-change-pointer-value
 (V788 V789 V790 V791)
 (cond
  ((= () V791) (cons (cons (cons V788 (cons V789 ())) V790) ()))
  ((and
    (cons? V791)
    (and
     (cons? (hd V791))
     (and
      (cons? (hd (hd V791)))
      (and
       (cons? (tl (hd (hd V791))))
       (and
        (= () (tl (tl (hd (hd V791)))))
        (and
         (= (hd (tl (hd (hd V791)))) V789)
         (= (hd (hd (hd V791))) V788)))))))
   (cons (cons (hd (hd V791)) V790) (tl V791)))
  ((cons? V791)
   (cons
    (hd V791)
    (shen-change-pointer-value V788 V789 V790 (tl V791))))
  (true (shen-sys-error 'shen-change-pointer-value))))

(defun
 get
 (V794 V795 V796)
 (let
  N
  (hash V794 (limit V796))
  (let
   Entry
   (trap-error
    (<-vector V796 N)
    (lambda E (interror "pointer not found~%" ())))
   (let
    Result
    (assoc (cons V794 (cons V795 ())) Entry)
    (if
     (empty? Result)
     (interror "value not found~%" ())
     (tl Result))))))

(defun
 hash
 (V797 V798)
 (let
  Hash
  (shen-mod
   (sum (map (lambda V799 (string->n V799)) (explode V797)))
   V798)
  (if (= 0 Hash) 1 Hash)))

(defun
 shen-mod
 (V800 V801)
 (shen-modh V800 (shen-multiples V800 (cons V801 ()))))

(defun
 shen-multiples
 (V802 V803)
 (cond
  ((and (cons? V803) (> (hd V803) V802)) (tl V803))
  ((cons? V803) (recur V802 (cons (* 2 (hd V803)) V803)))
  (true (shen-sys-error 'shen-multiples))))

(defun
 shen-modh
 (V806 V807)
 (cond
  ((= 0 V806) 0)
  ((= () V807) V806)
  ((and (cons? V807) (> (hd V807) V806))
   (if (empty? (tl V807)) V806 (shen-modh V806 (tl V807))))
  ((cons? V807) (recur (- V806 (hd V807)) V807))
  (true (shen-sys-error 'shen-modh))))

(defun
 sum
 (V808)
 (cond
  ((= () V808) 0)
  ((cons? V808) (+ (hd V808) (sum (tl V808))))
  (true (shen-sys-error 'sum))))

(defun
 head
 (V815)
 (cond
  ((cons? V815) (hd V815))
  (true (interror "head expects a non-empty list" ()))))

(defun
 tail
 (V822)
 (cond
  ((cons? V822) (tl V822))
  (true (interror "tail expects a non-empty list" ()))))

(defun hdstr (V823) (pos V823 0))

(defun
 intersection
 (V826 V827)
 (cond
  ((= () V826) ())
  ((cons? V826)
   (if
    (element? (hd V826) V827)
    (cons (hd V826) (intersection (tl V826) V827))
    (intersection (tl V826) V827)))
  (true (shen-sys-error 'intersection))))

(defun reverse (V828) (shen-reverse_help V828 ()))

(defun
 shen-reverse_help
 (V829 V830)
 (cond
  ((= () V829) V830)
  ((cons? V829) (recur (tl V829) (cons (hd V829) V830)))
  (true (shen-sys-error 'shen-reverse_help))))

(defun
 union
 (V831 V832)
 (cond
  ((= () V831) V832)
  ((cons? V831)
   (if
    (element? (hd V831) V832)
    (union (tl V831) V832)
    (cons (hd V831) (union (tl V831) V832))))
  (true (shen-sys-error 'union))))

(defun
 y-or-n?
 (V1793)
 (let
  Message
  (intoutput V1793 ())
  (let
   Y-or-N
   (intoutput " (y/n) " ())
   (let
    Input
    (input)
    (if
     (= 'y Input)
     true
     (if
      (= 'n Input)
      false
      (do (intoutput "please answer y or n~%" ()) (recur V1793))))))))

(defun not (V834) (if V834 false true))

(defun
 subst
 (V843 V844 V845)
 (cond
  ((= V845 V844) V843)
  ((cons? V845)
   (cons (subst V843 V844 (hd V845)) (subst V843 V844 (tl V845))))
  (true V845)))

(defun
 cd
 (V847)
 (set
  '*home-directory*
  (if (= V847 "") "" (intmake-string "~A/" (__at__p V847 ())))))

(defun
 map
 (V850 V851)
 (cond
  ((= () V851) ())
  ((cons? V851)
   (cons ((function V850) (hd V851)) (map V850 (tl V851))))
  (true (shen-sys-error 'map))))

(defun length (V852) (shen-length-h V852 0))

(defun
 shen-length-h
 (V853 V854)
 (cond ((= () V853) V854) (true (recur (tl V853) (+ V854 1)))))

(defun
 occurrences
 (V863 V864)
 (cond
  ((= V864 V863) 1)
  ((cons? V864)
   (+ (occurrences V863 (hd V864)) (occurrences V863 (tl V864))))
  (true 0)))

(defun
 nth
 (V872 V873)
 (cond
  ((and (= 1 V872) (cons? V873)) (hd V873))
  ((cons? V873) (recur (- V872 1) (tl V873)))
  (true (shen-sys-error 'nth))))

(defun
 integer?
 (V874)
 (and
  (number? V874)
  (let
   Abs
   (shen-abs V874)
   (shen-integer-test? Abs (shen-magless Abs 1)))))

(defun shen-abs (V875) (if (> V875 0) V875 (- 0 V875)))

(defun
 shen-magless
 (V876 V877)
 (let Nx2 (* V877 2) (if (> Nx2 V876) V877 (recur V876 Nx2))))

(defun
 shen-integer-test?
 (V881 V882)
 (cond
  ((= 0 V881) true)
  ((> 1 V881) false)
  (true
   (let
    Abs-N
    (- V881 V882)
    (if
     (> 0 Abs-N)
     (integer? V881)
     (shen-integer-test? Abs-N V882))))))

(defun
 mapcan
 (V885 V886)
 (cond
  ((= () V886) ())
  ((cons? V886)
   (append ((function V885) (hd V886)) (mapcan V885 (tl V886))))
  (true (shen-sys-error 'mapcan))))

(defun
 read-file-as-bytelist
 (V887)
 (let
  Stream
  (open 'file V887 'in)
  (let
   Byte
   (read-byte Stream)
   (let
    Bytes
    (shen-read-file-as-bytelist-help Stream Byte ())
    (let Close (close Stream) (reverse Bytes))))))

(defun
 shen-read-file-as-bytelist-help
 (V888 V889 V890)
 (cond
  ((= -1 V889) V890)
  (true (recur V888 (read-byte V888) (cons V889 V890)))))

(defun
 read-file-as-string
 (V891)
 (let
  Stream
  (open 'file V891 'in)
  (shen-rfas-h Stream (read-byte Stream) "")))

(defun
 shen-rfas-h
 (V892 V893 V894)
 (cond
  ((= -1 V893) (do (close V892) V894))
  (true (recur V892 (read-byte V892) (cn V894 (n->string V893))))))

(defun == (V903 V904) (cond ((= V904 V903) true) (true false)))

(defun abort () (simple-error ""))

(defun read () (hd (lineread)))

(defun input () (eval (read)))

(defun
 input+
 (V910 V911)
 (let
  Input
  (read)
  (let
   Check
   (shen-typecheck Input V911)
   (if
    (= false Check)
    (do
     (intoutput
      "input is not of type ~R: please re-enter "
      (__at__p V911 ()))
     (recur (intern ":") V911))
    (eval Input)))))

(defun
 bound?
 (V912)
 (and
  (symbol? V912)
  (let
   Val
   (trap-error (value V912) (lambda E 'shen-this-symbol-is-unbound))
   (if (= Val 'shen-this-symbol-is-unbound) false true))))

(defun
 shen-string->bytes
 (V913)
 (cond
  ((= "" V913) ())
  (true
   (cons (string->n (pos V913 0)) (shen-string->bytes (tlstr V913))))))

(defun maxinferences (V914) (set 'shen-*maxinferences* V914))

(defun inferences (V919) (value 'shen-*infs*))

(defun
 shen-hush
 (V924)
 (cond
  ((= '+ V924) (set 'shen-*hush* 'shen-hushed))
  ((= '- V924) (set 'shen-*hush* 'shen-unhushed))
  (true (interror "'hush' expects a + or a -~%" ()))))

(clojure.core/comment "klambda/writer.kl")

(defun
 print
 (V1040)
 (do
  (pr
   (shen-ms-h (cons "~" (cons "S" ())) (__at__p V1040 'shen-skip))
   (stinput 0))
  V1040))

(defun
 format
 (V1041 V1042 V1043)
 (cond
  ((= true V1041) (intoutput V1042 (__at__p V1043 ())))
  ((= false V1041) (intmake-string V1042 (__at__p V1043 ())))
  (true (pr (shen-ms-h (explode V1042) V1043) V1041))))

(defun
 intoutput
 (V1048 V1049)
 (cond
  ((= (value 'shen-*hush*) "Shen hushed") "Shen hushed")
  ((= "Shen unhushed" V1048) "Shen unhushed")
  (true
   (pr (shen-ms-h (shen-explode-string V1048) V1049) (stinput 0)))))

(defun
 interror
 (V1050 V1051)
 (simple-error (shen-ms-h (shen-explode-string V1050) V1051)))

(defun
 intmake-string
 (V1052 V1053)
 (shen-ms-h (shen-explode-string V1052) V1053))

(defun
 shen-ms-h
 (V1056 V1057)
 (cond
  ((= () V1056) "")
  ((and
    (cons? V1056)
    (and
     (= "~" (hd V1056))
     (and (cons? (tl V1056)) (= "%" (hd (tl V1056))))))
   (cn (n->string 10) (shen-ms-h (tl (tl V1056)) V1057)))
  ((and
    (cons? V1056)
    (and
     (= "~" (hd V1056))
     (and
      (cons? (tl V1056))
      (and
       (tuple? V1057)
       (element?
        (hd (tl V1056))
        (cons "A" (cons "S" (cons "R" ()))))))))
   (cn
    (shen-ob->str (hd (tl V1056)) (fst V1057))
    (shen-ms-h (tl (tl V1056)) (snd V1057))))
  ((cons? V1056) (cn (hd V1056) (shen-ms-h (tl V1056) V1057)))
  (true (shen-sys-error 'shen-ms-h))))

(defun
 shen-ob->str
 (V1060 V1061)
 (cond
  ((= () V1061) (if (= V1060 "R") "()" "[]"))
  ((= V1061 (vector 0)) "<>")
  ((cons? V1061)
   (shen-cn-all
    (append
     (if (= V1060 "R") (cons "(" ()) (cons "[" ()))
     (append
      (cons (shen-ob->str V1060 (hd V1061)) ())
      (append
       (shen-xmapcan
        (value '*maximum-print-sequence-size*)
        (lambda Z (cons " " (cons (shen-ob->str V1060 Z) ())))
        (tl V1061))
       (if (= V1060 "R") (cons ")" ()) (cons "]" ())))))))
  ((vector? V1061)
   (let
    L
    (shen-vector->list V1061 1)
    (let
     E
     (tlstr
      (shen-cn-all
       (shen-xmapcan
        (- (value '*maximum-print-sequence-size*) 1)
        (lambda
         Z
         (cons " " (cons (shen-ob->str V1060 (shen-blank-fail Z)) ())))
        L)))
     (let V (cn "<" (cn E ">")) V))))
  ((and (not (string? V1061)) (absvector? V1061))
   (trap-error
    (shen-ob->str "A" ((function (<-address V1061 0)) V1061))
    (lambda
     Ignore
     (let
      L
      (shen-vector->list V1061 0)
      (let
       E
       (tlstr
        (shen-cn-all
         (shen-xmapcan
          (- (value '*maximum-print-sequence-size*) 1)
          (lambda Z (cons " " (cons (shen-ob->str V1060 Z) ())))
          L)))
       (let V (cn "<" (cn E ">")) V))))))
  ((= 'shen-vector-failure-object V1061) "...")
  (true (if (and (= V1060 "A") (string? V1061)) V1061 (str V1061)))))

(defun
 shen-blank-fail
 (V1062)
 (cond ((= V1062 (fail)) 'shen-vector-failure-object) (true V1062)))

(defun
 shen-tuple
 (V1063)
 (intmake-string
  "(__at__p ~S ~S)"
  (__at__p (fst V1063) (__at__p (snd V1063) ()))))

(defun
 shen-cn-all
 (V1064)
 (cond
  ((= () V1064) "")
  ((cons? V1064) (cn (hd V1064) (shen-cn-all (tl V1064))))
  (true (shen-sys-error 'shen-cn-all))))

(defun
 shen-xmapcan
 (V1077 V1078 V1079)
 (cond
  ((= () V1079) ())
  ((= 0 V1077) (cons "... etc" ()))
  ((cons? V1079)
   (append
    ((function V1078) (hd V1079))
    (shen-xmapcan (- V1077 1) V1078 (tl V1079))))
  (true (cons " |" ((function V1078) V1079)))))

(defun
 shen-vector->list
 (V1080 V1081)
 (let
  Y
  (trap-error (<-address V1080 V1081) (lambda E 'shen-out-of-range))
  (if
   (= Y 'shen-out-of-range)
   ()
   (cons Y (shen-vector->list V1080 (+ V1081 1))))))

(clojure.core/comment "klambda/declarations.kl")

(set 'shen-*installing-kl* false)

(set 'shen-*history* ())

(set 'shen-*tc* false)

(set 'shen-*property-vector* (vector 20000))

(set 'shen-*process-counter* 0)

(set 'shen-*varcounter* (vector 1000))

(set 'shen-*prologvectors* (vector 1000))

(set 'shen-*reader-macros* ())

(set '*printer* (cons 'shen-sys-print ()))

(set '*home-directory* ())

(set 'shen-*gensym* 0)

(set 'shen-*tracking* ())

(set '*home-directory* "")

(set
 'shen-*alphabet*
 (cons
  'A
  (cons
   'B
   (cons
    'C
    (cons
     'D
     (cons
      'E
      (cons
       'F
       (cons
        'G
        (cons
         'H
         (cons
          'I
          (cons
           'J
           (cons
            'K
            (cons
             'L
             (cons
              'M
              (cons
               'N
               (cons
                'O
                (cons
                 'P
                 (cons
                  'Q
                  (cons
                   'R
                   (cons
                    'S
                    (cons
                     'T
                     (cons
                      'U
                      (cons
                       'V
                       (cons
                        'W
                        (cons
                         'X
                         (cons
                          'Y
                          (cons 'Z ())))))))))))))))))))))))))))

(set
 'shen-*special*
 (cons
  '__at__p
  (cons
   '__at__s
   (cons
    '__at__v
    (cons
     'cons
     (cons
      'lambda
      (cons
       'let
       (cons 'type (cons 'where (cons 'set (cons 'open ())))))))))))

(set
 'shen-*extraspecial*
 (cons 'define (cons 'shen-process-datatype (cons 'input+ ()))))

(set 'shen-*spy* false)

(set 'shen-*datatypes* ())

(set 'shen-*alldatatypes* ())

(set 'shen-*synonyms* ())

(set 'shen-*system* ())

(set 'shen-*signedfuncs* ())

(set 'shen-*hush* "Shen unhushed")

(set 'shen-*maxcomplexity* 128)

(set 'shen-*occurs* true)

(set 'shen-*maxinferences* 1000000)

(set '*maximum-print-sequence-size* 20)

(set 'shen-*catch* 0)

(defun
 shen-initialise_arity_table
 (V1497)
 (cond
  ((= () V1497) ())
  ((and (cons? V1497) (cons? (tl V1497)))
   (let
    DecArity
    (put
     (hd V1497)
     'arity
     (hd (tl V1497))
     (value 'shen-*property-vector*))
    (shen-initialise_arity_table (tl (tl V1497)))))
  (true (shen-sys-error 'shen-initialise_arity_table))))

(defun
 arity
 (V1498)
 (trap-error
  (get V1498 'arity (value 'shen-*property-vector*))
  (lambda E -1)))

(shen-initialise_arity_table
 (cons
  'adjoin
  (cons
   2
   (cons
    'and
    (cons
     2
     (cons
      'append
      (cons
       2
       (cons
        'arity
        (cons
         1
         (cons
          'assoc
          (cons
           2
           (cons
            'boolean?
            (cons
             1
             (cons
              'cd
              (cons
               1
               (cons
                'compile
                (cons
                 3
                 (cons
                  'concat
                  (cons
                   2
                   (cons
                    'cons
                    (cons
                     2
                     (cons
                      'cons?
                      (cons
                       1
                       (cons
                        'cn
                        (cons
                         2
                         (cons
                          'declare
                          (cons
                           2
                           (cons
                            'destroy
                            (cons
                             1
                             (cons
                              'difference
                              (cons
                               2
                               (cons
                                'do
                                (cons
                                 2
                                 (cons
                                  'dump
                                  (cons
                                   2
                                   (cons
                                    'element?
                                    (cons
                                     2
                                     (cons
                                      'empty?
                                      (cons
                                       1
                                       (cons
                                        'interror
                                        (cons
                                         2
                                         (cons
                                          'eval
                                          (cons
                                           1
                                           (cons
                                            'explode
                                            (cons
                                             1
                                             (cons
                                              'external
                                              (cons
                                               1
                                               (cons
                                                'fail-if
                                                (cons
                                                 2
                                                 (cons
                                                  'fail
                                                  (cons
                                                   0
                                                   (cons
                                                    'fix
                                                    (cons
                                                     2
                                                     (cons
                                                      'findall
                                                      (cons
                                                       5
                                                       (cons
                                                        'freeze
                                                        (cons
                                                         1
                                                         (cons
                                                          'fst
                                                          (cons
                                                           1
                                                           (cons
                                                            'gensym
                                                            (cons
                                                             1
                                                             (cons
                                                              'get
                                                              (cons
                                                               3
                                                               (cons
                                                                'address->
                                                                (cons
                                                                 3
                                                                 (cons
                                                                  '<-address
                                                                  (cons
                                                                   2
                                                                   (cons
                                                                    '<-vector
                                                                    (cons
                                                                     2
                                                                     (cons
                                                                      '>
                                                                      (cons
                                                                       2
                                                                       (cons
                                                                        '>=
                                                                        (cons
                                                                         2
                                                                         (cons
                                                                          '=
                                                                          (cons
                                                                           2
                                                                           (cons
                                                                            'hd
                                                                            (cons
                                                                             1
                                                                             (cons
                                                                              'hdv
                                                                              (cons
                                                                               1
                                                                               (cons
                                                                                'hdstr
                                                                                (cons
                                                                                 1
                                                                                 (cons
                                                                                  'head
                                                                                  (cons
                                                                                   1
                                                                                   (cons
                                                                                    'if
                                                                                    (cons
                                                                                     3
                                                                                     (cons
                                                                                      'integer?
                                                                                      (cons
                                                                                       1
                                                                                       (cons
                                                                                        'identical
                                                                                        (cons
                                                                                         4
                                                                                         (cons
                                                                                          'inferences
                                                                                          (cons
                                                                                           1
                                                                                           (cons
                                                                                            'intoutput
                                                                                            (cons
                                                                                             2
                                                                                             (cons
                                                                                              'make-string
                                                                                              (cons
                                                                                               2
                                                                                               (cons
                                                                                                'intersection
                                                                                                (cons
                                                                                                 2
                                                                                                 (cons
                                                                                                  'length
                                                                                                  (cons
                                                                                                   1
                                                                                                   (cons
                                                                                                    'lineread
                                                                                                    (cons
                                                                                                     0
                                                                                                     (cons
                                                                                                      'load
                                                                                                      (cons
                                                                                                       1
                                                                                                       (cons
                                                                                                        '<
                                                                                                        (cons
                                                                                                         2
                                                                                                         (cons
                                                                                                          '<=
                                                                                                          (cons
                                                                                                           2
                                                                                                           (cons
                                                                                                            'vector
                                                                                                            (cons
                                                                                                             1
                                                                                                             (cons
                                                                                                              'macroexpand
                                                                                                              (cons
                                                                                                               1
                                                                                                               (cons
                                                                                                                'map
                                                                                                                (cons
                                                                                                                 2
                                                                                                                 (cons
                                                                                                                  'mapcan
                                                                                                                  (cons
                                                                                                                   2
                                                                                                                   (cons
                                                                                                                    'intmake-string
                                                                                                                    (cons
                                                                                                                     2
                                                                                                                     (cons
                                                                                                                      'maxinferences
                                                                                                                      (cons
                                                                                                                       1
                                                                                                                       (cons
                                                                                                                        'not
                                                                                                                        (cons
                                                                                                                         1
                                                                                                                         (cons
                                                                                                                          'nth
                                                                                                                          (cons
                                                                                                                           2
                                                                                                                           (cons
                                                                                                                            'n->string
                                                                                                                            (cons
                                                                                                                             1
                                                                                                                             (cons
                                                                                                                              'number?
                                                                                                                              (cons
                                                                                                                               1
                                                                                                                               (cons
                                                                                                                                'output
                                                                                                                                (cons
                                                                                                                                 2
                                                                                                                                 (cons
                                                                                                                                  'occurs-check
                                                                                                                                  (cons
                                                                                                                                   1
                                                                                                                                   (cons
                                                                                                                                    'occurrences
                                                                                                                                    (cons
                                                                                                                                     2
                                                                                                                                     (cons
                                                                                                                                      'occurs-check
                                                                                                                                      (cons
                                                                                                                                       1
                                                                                                                                       (cons
                                                                                                                                        'or
                                                                                                                                        (cons
                                                                                                                                         2
                                                                                                                                         (cons
                                                                                                                                          'package
                                                                                                                                          (cons
                                                                                                                                           3
                                                                                                                                           (cons
                                                                                                                                            'print
                                                                                                                                            (cons
                                                                                                                                             1
                                                                                                                                             (cons
                                                                                                                                              'profile
                                                                                                                                              (cons
                                                                                                                                               1
                                                                                                                                               (cons
                                                                                                                                                'profile-results
                                                                                                                                                (cons
                                                                                                                                                 1
                                                                                                                                                 (cons
                                                                                                                                                  'ps
                                                                                                                                                  (cons
                                                                                                                                                   1
                                                                                                                                                   (cons
                                                                                                                                                    'preclude
                                                                                                                                                    (cons
                                                                                                                                                     1
                                                                                                                                                     (cons
                                                                                                                                                      'preclude-all-but
                                                                                                                                                      (cons
                                                                                                                                                       1
                                                                                                                                                       (cons
                                                                                                                                                        'address->
                                                                                                                                                        (cons
                                                                                                                                                         3
                                                                                                                                                         (cons
                                                                                                                                                          'put
                                                                                                                                                          (cons
                                                                                                                                                           4
                                                                                                                                                           (cons
                                                                                                                                                            'shen-reassemble
                                                                                                                                                            (cons
                                                                                                                                                             2
                                                                                                                                                             (cons
                                                                                                                                                              'read-file-as-string
                                                                                                                                                              (cons
                                                                                                                                                               1
                                                                                                                                                               (cons
                                                                                                                                                                'read-file
                                                                                                                                                                (cons
                                                                                                                                                                 1
                                                                                                                                                                 (cons
                                                                                                                                                                  'read-byte
                                                                                                                                                                  (cons
                                                                                                                                                                   1
                                                                                                                                                                   (cons
                                                                                                                                                                    'remove
                                                                                                                                                                    (cons
                                                                                                                                                                     2
                                                                                                                                                                     (cons
                                                                                                                                                                      'reverse
                                                                                                                                                                      (cons
                                                                                                                                                                       1
                                                                                                                                                                       (cons
                                                                                                                                                                        'set
                                                                                                                                                                        (cons
                                                                                                                                                                         2
                                                                                                                                                                         (cons
                                                                                                                                                                          'simple-error
                                                                                                                                                                          (cons
                                                                                                                                                                           1
                                                                                                                                                                           (cons
                                                                                                                                                                            'snd
                                                                                                                                                                            (cons
                                                                                                                                                                             1
                                                                                                                                                                             (cons
                                                                                                                                                                              'specialise
                                                                                                                                                                              (cons
                                                                                                                                                                               1
                                                                                                                                                                               (cons
                                                                                                                                                                                'spy
                                                                                                                                                                                (cons
                                                                                                                                                                                 1
                                                                                                                                                                                 (cons
                                                                                                                                                                                  'step
                                                                                                                                                                                  (cons
                                                                                                                                                                                   1
                                                                                                                                                                                   (cons
                                                                                                                                                                                    'string->n
                                                                                                                                                                                    (cons
                                                                                                                                                                                     1
                                                                                                                                                                                     (cons
                                                                                                                                                                                      'string?
                                                                                                                                                                                      (cons
                                                                                                                                                                                       1
                                                                                                                                                                                       (cons
                                                                                                                                                                                        'strong-warning
                                                                                                                                                                                        (cons
                                                                                                                                                                                         1
                                                                                                                                                                                         (cons
                                                                                                                                                                                          'subst
                                                                                                                                                                                          (cons
                                                                                                                                                                                           3
                                                                                                                                                                                           (cons
                                                                                                                                                                                            'symbol?
                                                                                                                                                                                            (cons
                                                                                                                                                                                             1
                                                                                                                                                                                             (cons
                                                                                                                                                                                              'tail
                                                                                                                                                                                              (cons
                                                                                                                                                                                               1
                                                                                                                                                                                               (cons
                                                                                                                                                                                                'tl
                                                                                                                                                                                                (cons
                                                                                                                                                                                                 1
                                                                                                                                                                                                 (cons
                                                                                                                                                                                                  'tc
                                                                                                                                                                                                  (cons
                                                                                                                                                                                                   1
                                                                                                                                                                                                   (cons
                                                                                                                                                                                                    'tc?
                                                                                                                                                                                                    (cons
                                                                                                                                                                                                     1
                                                                                                                                                                                                     (cons
                                                                                                                                                                                                      'thaw
                                                                                                                                                                                                      (cons
                                                                                                                                                                                                       1
                                                                                                                                                                                                       (cons
                                                                                                                                                                                                        'track
                                                                                                                                                                                                        (cons
                                                                                                                                                                                                         1
                                                                                                                                                                                                         (cons
                                                                                                                                                                                                          'trap-error
                                                                                                                                                                                                          (cons
                                                                                                                                                                                                           2
                                                                                                                                                                                                           (cons
                                                                                                                                                                                                            'tuple?
                                                                                                                                                                                                            (cons
                                                                                                                                                                                                             1
                                                                                                                                                                                                             (cons
                                                                                                                                                                                                              'type
                                                                                                                                                                                                              (cons
                                                                                                                                                                                                               1
                                                                                                                                                                                                               (cons
                                                                                                                                                                                                                'return
                                                                                                                                                                                                                (cons
                                                                                                                                                                                                                 3
                                                                                                                                                                                                                 (cons
                                                                                                                                                                                                                  'unprofile
                                                                                                                                                                                                                  (cons
                                                                                                                                                                                                                   1
                                                                                                                                                                                                                   (cons
                                                                                                                                                                                                                    'unify
                                                                                                                                                                                                                    (cons
                                                                                                                                                                                                                     4
                                                                                                                                                                                                                     (cons
                                                                                                                                                                                                                      'unify!
                                                                                                                                                                                                                      (cons
                                                                                                                                                                                                                       4
                                                                                                                                                                                                                       (cons
                                                                                                                                                                                                                        'union
                                                                                                                                                                                                                        (cons
                                                                                                                                                                                                                         2
                                                                                                                                                                                                                         (cons
                                                                                                                                                                                                                          'untrack
                                                                                                                                                                                                                          (cons
                                                                                                                                                                                                                           1
                                                                                                                                                                                                                           (cons
                                                                                                                                                                                                                            'unspecialise
                                                                                                                                                                                                                            (cons
                                                                                                                                                                                                                             1
                                                                                                                                                                                                                             (cons
                                                                                                                                                                                                                              'vector
                                                                                                                                                                                                                              (cons
                                                                                                                                                                                                                               1
                                                                                                                                                                                                                               (cons
                                                                                                                                                                                                                                'vector->
                                                                                                                                                                                                                                (cons
                                                                                                                                                                                                                                 3
                                                                                                                                                                                                                                 (cons
                                                                                                                                                                                                                                  'value
                                                                                                                                                                                                                                  (cons
                                                                                                                                                                                                                                   1
                                                                                                                                                                                                                                   (cons
                                                                                                                                                                                                                                    'variable?
                                                                                                                                                                                                                                    (cons
                                                                                                                                                                                                                                     1
                                                                                                                                                                                                                                     (cons
                                                                                                                                                                                                                                      'version
                                                                                                                                                                                                                                      (cons
                                                                                                                                                                                                                                       1
                                                                                                                                                                                                                                       (cons
                                                                                                                                                                                                                                        'warn
                                                                                                                                                                                                                                        (cons
                                                                                                                                                                                                                                         1
                                                                                                                                                                                                                                         (cons
                                                                                                                                                                                                                                          'write-to-file
                                                                                                                                                                                                                                          (cons
                                                                                                                                                                                                                                           2
                                                                                                                                                                                                                                           (cons
                                                                                                                                                                                                                                            'y-or-n?
                                                                                                                                                                                                                                            (cons
                                                                                                                                                                                                                                             1
                                                                                                                                                                                                                                             (cons
                                                                                                                                                                                                                                              '+
                                                                                                                                                                                                                                              (cons
                                                                                                                                                                                                                                               2
                                                                                                                                                                                                                                               (cons
                                                                                                                                                                                                                                                '*
                                                                                                                                                                                                                                                (cons
                                                                                                                                                                                                                                                 2
                                                                                                                                                                                                                                                 (cons
                                                                                                                                                                                                                                                  '/
                                                                                                                                                                                                                                                  (cons
                                                                                                                                                                                                                                                   2
                                                                                                                                                                                                                                                   (cons
                                                                                                                                                                                                                                                    '-
                                                                                                                                                                                                                                                    (cons
                                                                                                                                                                                                                                                     2
                                                                                                                                                                                                                                                     (cons
                                                                                                                                                                                                                                                      '==
                                                                                                                                                                                                                                                      (cons
                                                                                                                                                                                                                                                       2
                                                                                                                                                                                                                                                       (cons
                                                                                                                                                                                                                                                        '__at__p
                                                                                                                                                                                                                                                        (cons
                                                                                                                                                                                                                                                         2
                                                                                                                                                                                                                                                         (cons
                                                                                                                                                                                                                                                          '__at__v
                                                                                                                                                                                                                                                          (cons
                                                                                                                                                                                                                                                           2
                                                                                                                                                                                                                                                           (cons
                                                                                                                                                                                                                                                            '__at__s
                                                                                                                                                                                                                                                            (cons
                                                                                                                                                                                                                                                             2
                                                                                                                                                                                                                                                             (cons
                                                                                                                                                                                                                                                              'preclude
                                                                                                                                                                                                                                                              (cons
                                                                                                                                                                                                                                                               1
                                                                                                                                                                                                                                                               (cons
                                                                                                                                                                                                                                                                'include
                                                                                                                                                                                                                                                                (cons
                                                                                                                                                                                                                                                                 1
                                                                                                                                                                                                                                                                 (cons
                                                                                                                                                                                                                                                                  'preclude-all-but
                                                                                                                                                                                                                                                                  (cons
                                                                                                                                                                                                                                                                   1
                                                                                                                                                                                                                                                                   (cons
                                                                                                                                                                                                                                                                    'include-all-but
                                                                                                                                                                                                                                                                    (cons
                                                                                                                                                                                                                                                                     1
                                                                                                                                                                                                                                                                     (cons
                                                                                                                                                                                                                                                                      'where
                                                                                                                                                                                                                                                                      (cons
                                                                                                                                                                                                                                                                       2
                                                                                                                                                                                                                                                                       ())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

(defun
 systemf
 (V1499)
 (set 'shen-*system* (adjoin V1499 (value 'shen-*system*))))

(defun
 adjoin
 (V1500 V1501)
 (if (element? V1500 V1501) V1501 (cons V1500 V1501)))

(map
 (lambda V1502 (systemf V1502))
 (cons
  '!
  (cons
   (intern "}")
   (cons
    (intern "{")
    (cons
     '-->
     (cons
      '<--
      (cons
       '&&
       (cons
        (intern ":")
        (cons
         (intern ";")
         (cons
          (intern ":-")
          (cons
           (intern ":=")
           (cons
            (intern "_")
            (cons
             '-s-
             (cons
              '-o-
              (cons
               '-*-
               (cons
                '*language*
                (cons
                 '*implementation*
                 (cons
                  '*stinput*
                  (cons
                   '*home-directory*
                   (cons
                    '*version*
                    (cons
                     '*maximum-print-sequence-size*
                     (cons
                      '*printer*
                      (cons
                       '*macros*
                       (cons
                        '*os*
                        (cons
                         '*release*
                         (cons
                          '__at__v
                          (cons
                           '__at__p
                           (cons
                            '__at__s
                            (cons
                             '<-
                             (cons
                              '->
                              (cons
                               '<e>
                               (cons
                                '==
                                (cons
                                 '=
                                 (cons
                                  '>=
                                  (cons
                                   '>
                                   (cons
                                    (intern "/.")
                                    (cons
                                     '=!
                                     (cons
                                      '-
                                      (cons
                                       '/
                                       (cons
                                        '*
                                        (cons
                                         '+
                                         (cons
                                          '<=
                                          (cons
                                           '<
                                           (cons
                                            '>>
                                            (cons
                                             '<>
                                             (cons
                                              'y-or-n?
                                              (cons
                                               'write-to-file
                                               (cons
                                                'where
                                                (cons
                                                 'when
                                                 (cons
                                                  'warn
                                                  (cons
                                                   'version
                                                   (cons
                                                    'verified
                                                    (cons
                                                     'variable?
                                                     (cons
                                                      'value
                                                      (cons
                                                       'vector->
                                                       (cons
                                                        '<-vector
                                                        (cons
                                                         'vector
                                                         (cons
                                                          'vector?
                                                          (cons
                                                           'unspecialise
                                                           (cons
                                                            'untrack
                                                            (cons
                                                             'union
                                                             (cons
                                                              'unify
                                                              (cons
                                                               'unify!
                                                               (cons
                                                                'unprofile
                                                                (cons
                                                                 'return
                                                                 (cons
                                                                  'type
                                                                  (cons
                                                                   'tuple?
                                                                   (cons
                                                                    true
                                                                    (cons
                                                                     'trap-error
                                                                     (cons
                                                                      'track
                                                                      (cons
                                                                       'time
                                                                       (cons
                                                                        'thaw
                                                                        (cons
                                                                         'tc?
                                                                         (cons
                                                                          'tc
                                                                          (cons
                                                                           'tl
                                                                           (cons
                                                                            'tlstr
                                                                            (cons
                                                                             'tlv
                                                                             (cons
                                                                              'tail
                                                                              (cons
                                                                               'systemf
                                                                               (cons
                                                                                'synonyms
                                                                                (cons
                                                                                 'symbol
                                                                                 (cons
                                                                                  'symbol?
                                                                                  (cons
                                                                                   'sum
                                                                                   (cons
                                                                                    'subst
                                                                                    (cons
                                                                                     'string?
                                                                                     (cons
                                                                                      'string->n
                                                                                      (cons
                                                                                       'stream
                                                                                       (cons
                                                                                        'string
                                                                                        (cons
                                                                                         'stinput
                                                                                         (cons
                                                                                          'step
                                                                                          (cons
                                                                                           'spy
                                                                                           (cons
                                                                                            'specialise
                                                                                            (cons
                                                                                             'snd
                                                                                             (cons
                                                                                              'simple-error
                                                                                              (cons
                                                                                               'set
                                                                                               (cons
                                                                                                'save
                                                                                                (cons
                                                                                                 'str
                                                                                                 (cons
                                                                                                  'run
                                                                                                  (cons
                                                                                                   'reverse
                                                                                                   (cons
                                                                                                    'remove
                                                                                                    (cons
                                                                                                     'read
                                                                                                     (cons
                                                                                                      'read-file
                                                                                                      (cons
                                                                                                       'read-file-as-bytelist
                                                                                                       (cons
                                                                                                        'read-file-as-string
                                                                                                        (cons
                                                                                                         'read-byte
                                                                                                         (cons
                                                                                                          'quit
                                                                                                          (cons
                                                                                                           'put
                                                                                                           (cons
                                                                                                            'preclude
                                                                                                            (cons
                                                                                                             'preclude-all-but
                                                                                                             (cons
                                                                                                              'ps
                                                                                                              (cons
                                                                                                               'prolog?
                                                                                                               (cons
                                                                                                                'profile-results
                                                                                                                (cons
                                                                                                                 'profile
                                                                                                                 (cons
                                                                                                                  'print
                                                                                                                  (cons
                                                                                                                   'pr
                                                                                                                   (cons
                                                                                                                    'pos
                                                                                                                    (cons
                                                                                                                     'package
                                                                                                                     (cons
                                                                                                                      'output
                                                                                                                      (cons
                                                                                                                       'out
                                                                                                                       (cons
                                                                                                                        'or
                                                                                                                        (cons
                                                                                                                         'open
                                                                                                                         (cons
                                                                                                                          'occurrences
                                                                                                                          (cons
                                                                                                                           'occurs-check
                                                                                                                           (cons
                                                                                                                            'n->string
                                                                                                                            (cons
                                                                                                                             'number?
                                                                                                                             (cons
                                                                                                                              'number
                                                                                                                              (cons
                                                                                                                               'null
                                                                                                                               (cons
                                                                                                                                'nth
                                                                                                                                (cons
                                                                                                                                 'not
                                                                                                                                 (cons
                                                                                                                                  'nl
                                                                                                                                  (cons
                                                                                                                                   'mode
                                                                                                                                   (cons
                                                                                                                                    'macro
                                                                                                                                    (cons
                                                                                                                                     'macroexpand
                                                                                                                                     (cons
                                                                                                                                      'maxinferences
                                                                                                                                      (cons
                                                                                                                                       'mapcan
                                                                                                                                       (cons
                                                                                                                                        'map
                                                                                                                                        (cons
                                                                                                                                         'make-string
                                                                                                                                         (cons
                                                                                                                                          'load
                                                                                                                                          (cons
                                                                                                                                           'loaded
                                                                                                                                           (cons
                                                                                                                                            'list
                                                                                                                                            (cons
                                                                                                                                             'lineread
                                                                                                                                             (cons
                                                                                                                                              'limit
                                                                                                                                              (cons
                                                                                                                                               'length
                                                                                                                                               (cons
                                                                                                                                                'let
                                                                                                                                                (cons
                                                                                                                                                 'lazy
                                                                                                                                                 (cons
                                                                                                                                                  'lambda
                                                                                                                                                  (cons
                                                                                                                                                   'is
                                                                                                                                                   (cons
                                                                                                                                                    'intersection
                                                                                                                                                    (cons
                                                                                                                                                     'inferences
                                                                                                                                                     (cons
                                                                                                                                                      'intern
                                                                                                                                                      (cons
                                                                                                                                                       'integer?
                                                                                                                                                       (cons
                                                                                                                                                        'input
                                                                                                                                                        (cons
                                                                                                                                                         'input+
                                                                                                                                                         (cons
                                                                                                                                                          'include
                                                                                                                                                          (cons
                                                                                                                                                           'include-all-but
                                                                                                                                                           (cons
                                                                                                                                                            'in
                                                                                                                                                            (cons
                                                                                                                                                             'if
                                                                                                                                                             (cons
                                                                                                                                                              'identical
                                                                                                                                                              (cons
                                                                                                                                                               'head
                                                                                                                                                               (cons
                                                                                                                                                                'hd
                                                                                                                                                                (cons
                                                                                                                                                                 'hdv
                                                                                                                                                                 (cons
                                                                                                                                                                  'hdstr
                                                                                                                                                                  (cons
                                                                                                                                                                   'hash
                                                                                                                                                                   (cons
                                                                                                                                                                    'get
                                                                                                                                                                    (cons
                                                                                                                                                                     'get-time
                                                                                                                                                                     (cons
                                                                                                                                                                      'gensym
                                                                                                                                                                      (cons
                                                                                                                                                                       'function
                                                                                                                                                                       (cons
                                                                                                                                                                        'fst
                                                                                                                                                                        (cons
                                                                                                                                                                         'freeze
                                                                                                                                                                         (cons
                                                                                                                                                                          'format
                                                                                                                                                                          (cons
                                                                                                                                                                           'fix
                                                                                                                                                                           (cons
                                                                                                                                                                            'file
                                                                                                                                                                            (cons
                                                                                                                                                                             'fail
                                                                                                                                                                             (cons
                                                                                                                                                                              'fail!
                                                                                                                                                                              (cons
                                                                                                                                                                               'fail-if
                                                                                                                                                                               (cons
                                                                                                                                                                                'fwhen
                                                                                                                                                                                (cons
                                                                                                                                                                                 'findall
                                                                                                                                                                                 (cons
                                                                                                                                                                                  false
                                                                                                                                                                                  (cons
                                                                                                                                                                                   'explode
                                                                                                                                                                                   (cons
                                                                                                                                                                                    'external
                                                                                                                                                                                    (cons
                                                                                                                                                                                     'exception
                                                                                                                                                                                     (cons
                                                                                                                                                                                      'eval-without-macros
                                                                                                                                                                                      (cons
                                                                                                                                                                                       'eval
                                                                                                                                                                                       (cons
                                                                                                                                                                                        'error-to-string
                                                                                                                                                                                        (cons
                                                                                                                                                                                         'error
                                                                                                                                                                                         (cons
                                                                                                                                                                                          'empty?
                                                                                                                                                                                          (cons
                                                                                                                                                                                           'element?
                                                                                                                                                                                           (cons
                                                                                                                                                                                            'dump
                                                                                                                                                                                            (cons
                                                                                                                                                                                             'dumped
                                                                                                                                                                                             (cons
                                                                                                                                                                                              'do
                                                                                                                                                                                              (cons
                                                                                                                                                                                               'difference
                                                                                                                                                                                               (cons
                                                                                                                                                                                                'destroy
                                                                                                                                                                                                (cons
                                                                                                                                                                                                 'defun
                                                                                                                                                                                                 (cons
                                                                                                                                                                                                  'define
                                                                                                                                                                                                  (cons
                                                                                                                                                                                                   'defmacro
                                                                                                                                                                                                   (cons
                                                                                                                                                                                                    'defcc
                                                                                                                                                                                                    (cons
                                                                                                                                                                                                     'defprolog
                                                                                                                                                                                                     (cons
                                                                                                                                                                                                      'declare
                                                                                                                                                                                                      (cons
                                                                                                                                                                                                       'datatype
                                                                                                                                                                                                       (cons
                                                                                                                                                                                                        'cut
                                                                                                                                                                                                        (cons
                                                                                                                                                                                                         'cn
                                                                                                                                                                                                         (cons
                                                                                                                                                                                                          'cons?
                                                                                                                                                                                                          (cons
                                                                                                                                                                                                           'cons
                                                                                                                                                                                                           (cons
                                                                                                                                                                                                            'cond
                                                                                                                                                                                                            (cons
                                                                                                                                                                                                             'concat
                                                                                                                                                                                                             (cons
                                                                                                                                                                                                              'compile
                                                                                                                                                                                                              (cons
                                                                                                                                                                                                               'cd
                                                                                                                                                                                                               (cons
                                                                                                                                                                                                                'cases
                                                                                                                                                                                                                (cons
                                                                                                                                                                                                                 'call
                                                                                                                                                                                                                 (cons
                                                                                                                                                                                                                  'close
                                                                                                                                                                                                                  (cons
                                                                                                                                                                                                                   'bind
                                                                                                                                                                                                                   (cons
                                                                                                                                                                                                                    'bound?
                                                                                                                                                                                                                    (cons
                                                                                                                                                                                                                     'boolean?
                                                                                                                                                                                                                     (cons
                                                                                                                                                                                                                      'boolean
                                                                                                                                                                                                                      (cons
                                                                                                                                                                                                                       'bar!
                                                                                                                                                                                                                       (cons
                                                                                                                                                                                                                        'assoc
                                                                                                                                                                                                                        (cons
                                                                                                                                                                                                                         'arity
                                                                                                                                                                                                                         (cons
                                                                                                                                                                                                                          'append
                                                                                                                                                                                                                          (cons
                                                                                                                                                                                                                           'and
                                                                                                                                                                                                                           (cons
                                                                                                                                                                                                                            'adjoin
                                                                                                                                                                                                                            (cons
                                                                                                                                                                                                                             '<-address
                                                                                                                                                                                                                             (cons
                                                                                                                                                                                                                              'address->
                                                                                                                                                                                                                              (cons
                                                                                                                                                                                                                               'absvector?
                                                                                                                                                                                                                               (cons
                                                                                                                                                                                                                                'absvector
                                                                                                                                                                                                                                (cons
                                                                                                                                                                                                                                 'abort
                                                                                                                                                                                                                                 (cons
                                                                                                                                                                                                                                  'intmake-string
                                                                                                                                                                                                                                  (cons
                                                                                                                                                                                                                                   'intoutput
                                                                                                                                                                                                                                   (cons
                                                                                                                                                                                                                                    'interror
                                                                                                                                                                                                                                    ()))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

(defun
 specialise
 (V1503)
 (do (set 'shen-*special* (cons V1503 (value 'shen-*special*))) V1503))

(defun
 unspecialise
 (V1504)
 (do
  (set 'shen-*special* (remove V1504 (value 'shen-*special*)))
  V1504))

(clojure.core/comment "klambda/core.kl")

(defun
 shen-shen->kl
 (V363 V364)
 (compile
  (lambda V365 (shen-<define> V365))
  (cons V363 V364)
  (lambda X (shen-shen-syntax-error V363 X))))

(defun
 shen-shen-syntax-error
 (V366 V367)
 (interror
  "syntax error in ~A here:~%~% ~A~%"
  (__at__p V366 (__at__p (shen-next-50 50 V367) ()))))

(defun
 shen-<define>
 (V368)
 (let
  Result
  (let
   Parse_<name>
   (shen-<name> V368)
   (if
    (not (= (fail) Parse_<name>))
    (let
     Parse_<signature>
     (shen-<signature> Parse_<name>)
     (if
      (not (= (fail) Parse_<signature>))
      (let
       Parse_<rules>
       (shen-<rules> Parse_<signature>)
       (if
        (not (= (fail) Parse_<rules>))
        (shen-reassemble
         (fst Parse_<rules>)
         (shen-compile_to_machine_code
          (snd Parse_<name>)
          (snd Parse_<rules>)))
        (fail)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<name>
     (shen-<name> V368)
     (if
      (not (= (fail) Parse_<name>))
      (let
       Parse_<rules>
       (shen-<rules> Parse_<name>)
       (if
        (not (= (fail) Parse_<rules>))
        (shen-reassemble
         (fst Parse_<rules>)
         (shen-compile_to_machine_code
          (snd Parse_<name>)
          (snd Parse_<rules>)))
        (fail)))
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<name>
 (V369)
 (let
  Result
  (if
   (cons? (fst V369))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V369)) (snd V369)))
    (if
     (and
      (symbol? (hd (fst V369)))
      (not (shen-sysfunc? (hd (fst V369)))))
     (hd (fst V369))
     (interror
      "~A is not a legitimate function name.~%"
      (__at__p (hd (fst V369)) ()))))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun shen-sysfunc? (V370) (element? V370 (value 'shen-*system*)))

(defun
 shen-<signature>
 (V371)
 (let
  Result
  (if
   (and (cons? (fst V371)) (= (intern "{") (hd (fst V371))))
   (let
    Parse_<signature-help>
    (shen-<signature-help>
     (shen-reassemble (tl (fst V371)) (snd V371)))
    (if
     (not (= (fail) Parse_<signature-help>))
     (if
      (and
       (cons? (fst Parse_<signature-help>))
       (= (intern "}") (hd (fst Parse_<signature-help>))))
      (shen-reassemble
       (fst
        (shen-reassemble
         (tl (fst Parse_<signature-help>))
         (snd Parse_<signature-help>)))
       (shen-normalise-type
        (shen-curry-type (snd Parse_<signature-help>))))
      (fail))
     (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-curry-type
 (V374)
 (cond
  ((and
    (cons? V374)
    (and
     (cons? (tl V374))
     (and
      (= '--> (hd (tl V374)))
      (and
       (cons? (tl (tl V374)))
       (and
        (cons? (tl (tl (tl V374))))
        (= '--> (hd (tl (tl (tl V374))))))))))
   (recur (cons (hd V374) (cons '--> (cons (tl (tl V374)) ())))))
  ((and
    (cons? V374)
    (and
     (= 'cons (hd V374))
     (and
      (cons? (tl V374))
      (and (cons? (tl (tl V374))) (= () (tl (tl (tl V374))))))))
   (cons 'list (cons (shen-curry-type (hd (tl V374))) ())))
  ((and
    (cons? V374)
    (and
     (cons? (tl V374))
     (and
      (= '* (hd (tl V374)))
      (and
       (cons? (tl (tl V374)))
       (and
        (cons? (tl (tl (tl V374))))
        (= '* (hd (tl (tl (tl V374))))))))))
   (recur (cons (hd V374) (cons '* (cons (tl (tl V374)) ())))))
  ((cons? V374) (map (lambda V375 (shen-curry-type V375)) V374))
  (true V374)))

(defun
 shen-<signature-help>
 (V376)
 (let
  Result
  (if
   (cons? (fst V376))
   (let
    Parse_<signature-help>
    (shen-<signature-help>
     (shen-reassemble (tl (fst V376)) (snd V376)))
    (if
     (not (= (fail) Parse_<signature-help>))
     (shen-reassemble
      (fst Parse_<signature-help>)
      (if
       (element?
        (hd (fst V376))
        (cons (intern "{") (cons (intern "}") ())))
       (fail)
       (cons (hd (fst V376)) (snd Parse_<signature-help>))))
     (fail)))
   (fail))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<e>
     (<e> V376)
     (if
      (not (= (fail) Parse_<e>))
      (shen-reassemble (fst Parse_<e>) ())
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<rules>
 (V377)
 (let
  Result
  (let
   Parse_<rule>
   (shen-<rule> V377)
   (if
    (not (= (fail) Parse_<rule>))
    (let
     Parse_<rules>
     (shen-<rules> Parse_<rule>)
     (if
      (not (= (fail) Parse_<rules>))
      (shen-reassemble
       (fst Parse_<rules>)
       (cons (snd Parse_<rule>) (snd Parse_<rules>)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<rule>
     (shen-<rule> V377)
     (if
      (not (= (fail) Parse_<rule>))
      (shen-reassemble (fst Parse_<rule>) (cons (snd Parse_<rule>) ()))
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<rule>
 (V378)
 (let
  Result
  (let
   Parse_<patterns>
   (shen-<patterns> V378)
   (if
    (not (= (fail) Parse_<patterns>))
    (if
     (and
      (cons? (fst Parse_<patterns>))
      (= '-> (hd (fst Parse_<patterns>))))
     (let
      Parse_<action>
      (shen-<action>
       (shen-reassemble
        (tl (fst Parse_<patterns>))
        (snd Parse_<patterns>)))
      (if
       (not (= (fail) Parse_<action>))
       (if
        (and
         (cons? (fst Parse_<action>))
         (= 'where (hd (fst Parse_<action>))))
        (let
         Parse_<guard>
         (shen-<guard>
          (shen-reassemble
           (tl (fst Parse_<action>))
           (snd Parse_<action>)))
         (if
          (not (= (fail) Parse_<guard>))
          (shen-reassemble
           (fst Parse_<guard>)
           (cons
            (snd Parse_<patterns>)
            (cons
             (cons
              'where
              (cons
               (snd Parse_<guard>)
               (cons (snd Parse_<action>) ())))
             ())))
          (fail)))
        (fail))
       (fail)))
     (fail))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<patterns>
     (shen-<patterns> V378)
     (if
      (not (= (fail) Parse_<patterns>))
      (if
       (and
        (cons? (fst Parse_<patterns>))
        (= '-> (hd (fst Parse_<patterns>))))
       (let
        Parse_<action>
        (shen-<action>
         (shen-reassemble
          (tl (fst Parse_<patterns>))
          (snd Parse_<patterns>)))
        (if
         (not (= (fail) Parse_<action>))
         (shen-reassemble
          (fst Parse_<action>)
          (cons (snd Parse_<patterns>) (cons (snd Parse_<action>) ())))
         (fail)))
       (fail))
      (fail)))
    (if
     (= Result (fail))
     (let
      Result
      (let
       Parse_<patterns>
       (shen-<patterns> V378)
       (if
        (not (= (fail) Parse_<patterns>))
        (if
         (and
          (cons? (fst Parse_<patterns>))
          (= '<- (hd (fst Parse_<patterns>))))
         (let
          Parse_<action>
          (shen-<action>
           (shen-reassemble
            (tl (fst Parse_<patterns>))
            (snd Parse_<patterns>)))
          (if
           (not (= (fail) Parse_<action>))
           (if
            (and
             (cons? (fst Parse_<action>))
             (= 'where (hd (fst Parse_<action>))))
            (let
             Parse_<guard>
             (shen-<guard>
              (shen-reassemble
               (tl (fst Parse_<action>))
               (snd Parse_<action>)))
             (if
              (not (= (fail) Parse_<guard>))
              (shen-reassemble
               (fst Parse_<guard>)
               (cons
                (snd Parse_<patterns>)
                (cons
                 (cons
                  'where
                  (cons
                   (snd Parse_<guard>)
                   (cons
                    (cons
                     'shen-choicepoint!
                     (cons (snd Parse_<action>) ()))
                    ())))
                 ())))
              (fail)))
            (fail))
           (fail)))
         (fail))
        (fail)))
      (if
       (= Result (fail))
       (let
        Result
        (let
         Parse_<patterns>
         (shen-<patterns> V378)
         (if
          (not (= (fail) Parse_<patterns>))
          (if
           (and
            (cons? (fst Parse_<patterns>))
            (= '<- (hd (fst Parse_<patterns>))))
           (let
            Parse_<action>
            (shen-<action>
             (shen-reassemble
              (tl (fst Parse_<patterns>))
              (snd Parse_<patterns>)))
            (if
             (not (= (fail) Parse_<action>))
             (shen-reassemble
              (fst Parse_<action>)
              (cons
               (snd Parse_<patterns>)
               (cons
                (cons
                 'shen-choicepoint!
                 (cons (snd Parse_<action>) ()))
                ())))
             (fail)))
           (fail))
          (fail)))
        (if (= Result (fail)) (fail) Result))
       Result))
     Result))
   Result)))

(defun
 shen-fail_if
 (V379 V380)
 (if ((function V379) V380) (fail) V380))

(defun
 shen-succeeds?
 (V385)
 (cond ((= V385 (fail)) false) (true true)))

(defun
 shen-<patterns>
 (V386)
 (let
  Result
  (let
   Parse_<pattern>
   (shen-<pattern> V386)
   (if
    (not (= (fail) Parse_<pattern>))
    (let
     Parse_<patterns>
     (shen-<patterns> Parse_<pattern>)
     (if
      (not (= (fail) Parse_<patterns>))
      (shen-reassemble
       (fst Parse_<patterns>)
       (cons (snd Parse_<pattern>) (snd Parse_<patterns>)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<e>
     (<e> V386)
     (if
      (not (= (fail) Parse_<e>))
      (shen-reassemble (fst Parse_<e>) ())
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<pattern>
 (V387)
 (let
  Result
  (if
   (and (cons? (fst V387)) (cons? (hd (fst V387))))
   (shen-snd-or-fail
    (if
     (and
      (cons? (fst (shen-reassemble (hd (fst V387)) (snd V387))))
      (=
       '__at__p
       (hd (fst (shen-reassemble (hd (fst V387)) (snd V387))))))
     (let
      Parse_<pattern1>
      (shen-<pattern1>
       (shen-reassemble
        (tl (fst (shen-reassemble (hd (fst V387)) (snd V387))))
        (snd (shen-reassemble (hd (fst V387)) (snd V387)))))
      (if
       (not (= (fail) Parse_<pattern1>))
       (let
        Parse_<pattern2>
        (shen-<pattern2> Parse_<pattern1>)
        (if
         (not (= (fail) Parse_<pattern2>))
         (shen-reassemble
          (fst Parse_<pattern2>)
          (shen-reassemble
           (fst (shen-reassemble (tl (fst V387)) (snd V387)))
           (cons
            '__at__p
            (cons
             (snd Parse_<pattern1>)
             (cons (snd Parse_<pattern2>) ())))))
         (fail)))
       (fail)))
     (fail)))
   (fail))
  (if
   (= Result (fail))
   (let
    Result
    (if
     (and (cons? (fst V387)) (cons? (hd (fst V387))))
     (shen-snd-or-fail
      (if
       (and
        (cons? (fst (shen-reassemble (hd (fst V387)) (snd V387))))
        (=
         'cons
         (hd (fst (shen-reassemble (hd (fst V387)) (snd V387))))))
       (let
        Parse_<pattern1>
        (shen-<pattern1>
         (shen-reassemble
          (tl (fst (shen-reassemble (hd (fst V387)) (snd V387))))
          (snd (shen-reassemble (hd (fst V387)) (snd V387)))))
        (if
         (not (= (fail) Parse_<pattern1>))
         (let
          Parse_<pattern2>
          (shen-<pattern2> Parse_<pattern1>)
          (if
           (not (= (fail) Parse_<pattern2>))
           (shen-reassemble
            (fst Parse_<pattern2>)
            (shen-reassemble
             (fst (shen-reassemble (tl (fst V387)) (snd V387)))
             (cons
              'cons
              (cons
               (snd Parse_<pattern1>)
               (cons (snd Parse_<pattern2>) ())))))
           (fail)))
         (fail)))
       (fail)))
     (fail))
    (if
     (= Result (fail))
     (let
      Result
      (if
       (and (cons? (fst V387)) (cons? (hd (fst V387))))
       (shen-snd-or-fail
        (if
         (and
          (cons? (fst (shen-reassemble (hd (fst V387)) (snd V387))))
          (=
           '__at__v
           (hd (fst (shen-reassemble (hd (fst V387)) (snd V387))))))
         (let
          Parse_<pattern1>
          (shen-<pattern1>
           (shen-reassemble
            (tl (fst (shen-reassemble (hd (fst V387)) (snd V387))))
            (snd (shen-reassemble (hd (fst V387)) (snd V387)))))
          (if
           (not (= (fail) Parse_<pattern1>))
           (let
            Parse_<pattern2>
            (shen-<pattern2> Parse_<pattern1>)
            (if
             (not (= (fail) Parse_<pattern2>))
             (shen-reassemble
              (fst Parse_<pattern2>)
              (shen-reassemble
               (fst (shen-reassemble (tl (fst V387)) (snd V387)))
               (cons
                '__at__v
                (cons
                 (snd Parse_<pattern1>)
                 (cons (snd Parse_<pattern2>) ())))))
             (fail)))
           (fail)))
         (fail)))
       (fail))
      (if
       (= Result (fail))
       (let
        Result
        (if
         (and (cons? (fst V387)) (cons? (hd (fst V387))))
         (shen-snd-or-fail
          (if
           (and
            (cons? (fst (shen-reassemble (hd (fst V387)) (snd V387))))
            (=
             '__at__s
             (hd (fst (shen-reassemble (hd (fst V387)) (snd V387))))))
           (let
            Parse_<pattern1>
            (shen-<pattern1>
             (shen-reassemble
              (tl (fst (shen-reassemble (hd (fst V387)) (snd V387))))
              (snd (shen-reassemble (hd (fst V387)) (snd V387)))))
            (if
             (not (= (fail) Parse_<pattern1>))
             (let
              Parse_<pattern2>
              (shen-<pattern2> Parse_<pattern1>)
              (if
               (not (= (fail) Parse_<pattern2>))
               (shen-reassemble
                (fst Parse_<pattern2>)
                (shen-reassemble
                 (fst (shen-reassemble (tl (fst V387)) (snd V387)))
                 (cons
                  '__at__s
                  (cons
                   (snd Parse_<pattern1>)
                   (cons (snd Parse_<pattern2>) ())))))
               (fail)))
             (fail)))
           (fail)))
         (fail))
        (if
         (= Result (fail))
         (let
          Result
          (if
           (and (cons? (fst V387)) (cons? (hd (fst V387))))
           (shen-snd-or-fail
            (if
             (and
              (cons?
               (fst (shen-reassemble (hd (fst V387)) (snd V387))))
              (=
               'vector
               (hd
                (fst (shen-reassemble (hd (fst V387)) (snd V387))))))
             (if
              (and
               (cons?
                (fst
                 (shen-reassemble
                  (tl
                   (fst (shen-reassemble (hd (fst V387)) (snd V387))))
                  (snd (shen-reassemble (hd (fst V387)) (snd V387))))))
               (=
                0
                (hd
                 (fst
                  (shen-reassemble
                   (tl
                    (fst (shen-reassemble (hd (fst V387)) (snd V387))))
                   (snd
                    (shen-reassemble (hd (fst V387)) (snd V387))))))))
              (shen-reassemble
               (fst
                (shen-reassemble
                 (tl
                  (fst
                   (shen-reassemble
                    (tl
                     (fst
                      (shen-reassemble (hd (fst V387)) (snd V387))))
                    (snd
                     (shen-reassemble (hd (fst V387)) (snd V387))))))
                 (snd
                  (shen-reassemble
                   (tl
                    (fst (shen-reassemble (hd (fst V387)) (snd V387))))
                   (snd
                    (shen-reassemble (hd (fst V387)) (snd V387)))))))
               (shen-reassemble
                (fst (shen-reassemble (tl (fst V387)) (snd V387)))
                (cons 'vector (cons 0 ()))))
              (fail))
             (fail)))
           (fail))
          (if
           (= Result (fail))
           (let
            Result
            (if
             (cons? (fst V387))
             (shen-reassemble
              (fst (shen-reassemble (tl (fst V387)) (snd V387)))
              (if
               (cons? (hd (fst V387)))
               (interror
                "~A is not a legitimate constructor~%"
                (__at__p (hd (fst V387)) ()))
               (fail)))
             (fail))
            (if
             (= Result (fail))
             (let
              Result
              (let
               Parse_<simple_pattern>
               (shen-<simple_pattern> V387)
               (if
                (not (= (fail) Parse_<simple_pattern>))
                (shen-reassemble
                 (fst Parse_<simple_pattern>)
                 (snd Parse_<simple_pattern>))
                (fail)))
              (if (= Result (fail)) (fail) Result))
             Result))
           Result))
         Result))
       Result))
     Result))
   Result)))

(defun
 shen-<simple_pattern>
 (V388)
 (let
  Result
  (if
   (cons? (fst V388))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V388)) (snd V388)))
    (if (= (hd (fst V388)) '_) (gensym 'X) (fail)))
   (fail))
  (if
   (= Result (fail))
   (let
    Result
    (if
     (cons? (fst V388))
     (shen-reassemble
      (fst (shen-reassemble (tl (fst V388)) (snd V388)))
      (if
       (element? (hd (fst V388)) (cons '-> (cons '<- ())))
       (fail)
       (hd (fst V388))))
     (fail))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<pattern1>
 (V389)
 (let
  Result
  (let
   Parse_<pattern>
   (shen-<pattern> V389)
   (if
    (not (= (fail) Parse_<pattern>))
    (shen-reassemble (fst Parse_<pattern>) (snd Parse_<pattern>))
    (fail)))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<pattern2>
 (V390)
 (let
  Result
  (let
   Parse_<pattern>
   (shen-<pattern> V390)
   (if
    (not (= (fail) Parse_<pattern>))
    (shen-reassemble (fst Parse_<pattern>) (snd Parse_<pattern>))
    (fail)))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<action>
 (V391)
 (let
  Result
  (if
   (cons? (fst V391))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V391)) (snd V391)))
    (hd (fst V391)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<guard>
 (V392)
 (let
  Result
  (if
   (cons? (fst V392))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V392)) (snd V392)))
    (hd (fst V392)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-compile_to_machine_code
 (V393 V394)
 (let
  Lambda+
  (shen-compile_to_lambda+ V393 V394)
  (let
   KL
   (shen-compile_to_kl V393 Lambda+)
   (let Record (shen-record-source V393 KL) KL))))

(defun
 shen-record-source
 (V397 V398)
 (cond
  ((value 'shen-*installing-kl*) 'shen-skip)
  (true (put V397 'shen-source V398 (value 'shen-*property-vector*)))))

(defun
 shen-compile_to_lambda+
 (V399 V400)
 (let
  Arity
  (shen-aritycheck V399 V400)
  (let
   Free
   (map (lambda Rule (shen-free_variable_check V399 Rule)) V400)
   (let
    Variables
    (shen-parameters Arity)
    (let
     Linear
     (map 'shen-linearise V400)
     (let
      Abstractions
      (map (lambda V401 (shen-abstract_rule V401)) Linear)
      (let
       Applications
       (map
        (lambda X (shen-application_build Variables X))
        Abstractions)
       (cons Variables (cons Applications ())))))))))

(defun
 shen-free_variable_check
 (V402 V403)
 (cond
  ((and (cons? V403) (and (cons? (tl V403)) (= () (tl (tl V403)))))
   (let
    Bound
    (shen-extract_vars (hd V403))
    (let
     Free
     (shen-extract_free_vars Bound (hd (tl V403)))
     (shen-free_variable_warnings V402 Free))))
  (true (shen-sys-error 'shen-free_variable_check))))

(defun
 shen-extract_vars
 (V404)
 (cond
  ((variable? V404) (cons V404 ()))
  ((cons? V404)
   (union (shen-extract_vars (hd V404)) (shen-extract_vars (tl V404))))
  (true ())))

(defun
 shen-extract_free_vars
 (V413 V414)
 (cond
  ((and (variable? V414) (not (element? V414 V413))) (cons V414 ()))
  ((and
    (cons? V414)
    (and
     (= 'lambda (hd V414))
     (and
      (cons? (tl V414))
      (and (cons? (tl (tl V414))) (= () (tl (tl (tl V414))))))))
   (recur (cons (hd (tl V414)) V413) (hd (tl (tl V414)))))
  ((and
    (cons? V414)
    (and
     (= 'let (hd V414))
     (and
      (cons? (tl V414))
      (and
       (cons? (tl (tl V414)))
       (and
        (cons? (tl (tl (tl V414))))
        (= () (tl (tl (tl (tl V414))))))))))
   (union
    (shen-extract_free_vars V413 (hd (tl (tl V414))))
    (shen-extract_free_vars
     (cons (hd (tl V414)) V413)
     (hd (tl (tl (tl V414)))))))
  ((cons? V414)
   (union
    (shen-extract_free_vars V413 (hd V414))
    (shen-extract_free_vars V413 (tl V414))))
  (true ())))

(defun
 shen-free_variable_warnings
 (V417 V418)
 (cond
  ((= () V418) '_)
  (true
   (let
    Warning
    (intoutput
     "~%The following variables are free in ~A: "
     (__at__p V417 ()))
    (shen-list_variables V418)))))

(defun
 shen-list_variables
 (V419)
 (cond
  ((and (cons? V419) (= () (tl V419)))
   (intoutput "~A~%" (__at__p (hd V419) ())))
  ((cons? V419)
   (do
    (intoutput "~A, " (__at__p (hd V419) ()))
    (shen-list_variables (tl V419))))
  (true (shen-sys-error 'shen-list_variables))))

(defun
 shen-linearise
 (V420)
 (cond
  ((and (cons? V420) (and (cons? (tl V420)) (= () (tl (tl V420)))))
   (shen-linearise_help
    (shen-flatten (hd V420))
    (hd V420)
    (hd (tl V420))))
  (true (shen-sys-error 'shen-linearise))))

(defun
 shen-flatten
 (V421)
 (cond
  ((= () V421) ())
  ((cons? V421)
   (append (shen-flatten (hd V421)) (shen-flatten (tl V421))))
  (true (cons V421 ()))))

(defun
 shen-linearise_help
 (V422 V423 V424)
 (cond
  ((= () V422) (cons V423 (cons V424 ())))
  ((cons? V422)
   (if
    (and (variable? (hd V422)) (element? (hd V422) (tl V422)))
    (let
     Var
     (gensym (hd V422))
     (let
      NewAction
      (cons
       'where
       (cons (cons '= (cons (hd V422) (cons Var ()))) (cons V424 ())))
      (let
       NewPatts
       (shen-linearise_X (hd V422) Var V423)
       (shen-linearise_help (tl V422) NewPatts NewAction))))
    (shen-linearise_help (tl V422) V423 V424)))
  (true (shen-sys-error 'shen-linearise_help))))

(defun
 shen-linearise_X
 (V433 V434 V435)
 (cond
  ((= V435 V433) V434)
  ((cons? V435)
   (let
    L
    (shen-linearise_X V433 V434 (hd V435))
    (if
     (= L (hd V435))
     (cons (hd V435) (shen-linearise_X V433 V434 (tl V435)))
     (cons L (tl V435)))))
  (true V435)))

(defun
 shen-aritycheck
 (V437 V438)
 (cond
  ((and
    (cons? V438)
    (and
     (cons? (hd V438))
     (and
      (cons? (tl (hd V438)))
      (and (= () (tl (tl (hd V438)))) (= () (tl V438))))))
   (do
    (shen-aritycheck-action (hd (tl (hd V438))))
    (shen-aritycheck-name V437 (arity V437) (length (hd (hd V438))))))
  ((and
    (cons? V438)
    (and
     (cons? (hd V438))
     (and
      (cons? (tl (hd V438)))
      (and
       (= () (tl (tl (hd V438))))
       (and
        (cons? (tl V438))
        (and
         (cons? (hd (tl V438)))
         (and
          (cons? (tl (hd (tl V438))))
          (= () (tl (tl (hd (tl V438))))))))))))
   (if
    (= (length (hd (hd V438))) (length (hd (hd (tl V438)))))
    (do
     (shen-aritycheck-action 'Action)
     (shen-aritycheck V437 (tl V438)))
    (interror "arity error in ~A~%" (__at__p V437 ()))))
  (true (shen-sys-error 'shen-aritycheck))))

(defun
 shen-aritycheck-name
 (V447 V448 V449)
 (cond
  ((= -1 V448) V449)
  ((= V449 V448) V449)
  (true
   (do
    (intoutput
     "~%warning: changing the arity of ~A can cause errors.~%"
     (__at__p V447 ()))
    V449))))

(defun
 shen-aritycheck-action
 (V455)
 (cond
  ((cons? V455)
   (do
    (shen-aah (hd V455) (tl V455))
    (map (lambda V456 (shen-aritycheck-action V456)) V455)))
  (true 'shen-skip)))

(defun
 shen-aah
 (V457 V458)
 (let
  Arity
  (arity V457)
  (let
   Len
   (length V458)
   (if
    (and (> Arity -1) (> Len Arity))
    (intoutput
     "warning: ~A might not like ~A argument~A.~%"
     (__at__p V457 (__at__p Len (__at__p (if (> Len 1) "s" "") ()))))
    'shen-skip))))

(defun
 shen-abstract_rule
 (V459)
 (cond
  ((and (cons? V459) (and (cons? (tl V459)) (= () (tl (tl V459)))))
   (shen-abstraction_build (hd V459) (hd (tl V459))))
  (true (shen-sys-error 'shen-abstract_rule))))

(defun
 shen-abstraction_build
 (V460 V461)
 (cond
  ((= () V460) V461)
  ((cons? V460)
   (cons
    (intern "/.")
    (cons
     (hd V460)
     (cons (shen-abstraction_build (tl V460) V461) ()))))
  (true (shen-sys-error 'shen-abstraction_build))))

(defun
 shen-parameters
 (V462)
 (cond
  ((= 0 V462) ())
  (true (cons (gensym 'V) (shen-parameters (- V462 1))))))

(defun
 shen-application_build
 (V463 V464)
 (cond
  ((= () V463) V464)
  ((cons? V463) (recur (tl V463) (cons V464 (cons (hd V463) ()))))
  (true (shen-sys-error 'shen-application_build))))

(defun
 shen-compile_to_kl
 (V465 V466)
 (cond
  ((and (cons? V466) (and (cons? (tl V466)) (= () (tl (tl V466)))))
   (let
    Arity
    (shen-store-arity V465 (length (hd V466)))
    (let
     Reduce
     (map (lambda V467 (shen-reduce V467)) (hd (tl V466)))
     (let
      CondExpression
      (shen-cond-expression V465 (hd V466) Reduce)
      (let
       KL
       (cons
        'defun
        (cons V465 (cons (hd V466) (cons CondExpression ()))))
       KL)))))
  (true (shen-sys-error 'shen-compile_to_kl))))

(defun
 shen-store-arity
 (V470 V471)
 (cond
  ((value 'shen-*installing-kl*) 'shen-skip)
  (true (put V470 'arity V471 (value 'shen-*property-vector*)))))

(defun
 shen-reduce
 (V472)
 (do
  (set 'shen-*teststack* ())
  (let
   Result
   (shen-reduce_help V472)
   (cons
    (cons 'shen-tests (reverse (value 'shen-*teststack*)))
    (cons Result ())))))

(defun
 shen-reduce_help
 (V473)
 (cond
  ((and
    (cons? V473)
    (and
     (cons? (hd V473))
     (and
      (= (intern "/.") (hd (hd V473)))
      (and
       (cons? (tl (hd V473)))
       (and
        (cons? (hd (tl (hd V473))))
        (and
         (= 'cons (hd (hd (tl (hd V473)))))
         (and
          (cons? (tl (hd (tl (hd V473)))))
          (and
           (cons? (tl (tl (hd (tl (hd V473))))))
           (and
            (= () (tl (tl (tl (hd (tl (hd V473)))))))
            (and
             (cons? (tl (tl (hd V473))))
             (and
              (= () (tl (tl (tl (hd V473)))))
              (and (cons? (tl V473)) (= () (tl (tl V473)))))))))))))))
   (do
    (shen-add_test (cons 'cons? (tl V473)))
    (let
     Abstraction
     (cons
      (intern "/.")
      (cons
       (hd (tl (hd (tl (hd V473)))))
       (cons
        (cons
         (intern "/.")
         (cons
          (hd (tl (tl (hd (tl (hd V473))))))
          (cons
           (shen-ebr
            (hd (tl V473))
            (hd (tl (hd V473)))
            (hd (tl (tl (hd V473)))))
           ())))
        ())))
     (let
      Application
      (cons
       (cons Abstraction (cons (cons 'hd (tl V473)) ()))
       (cons (cons 'tl (tl V473)) ()))
      (shen-reduce_help Application)))))
  ((and
    (cons? V473)
    (and
     (cons? (hd V473))
     (and
      (= (intern "/.") (hd (hd V473)))
      (and
       (cons? (tl (hd V473)))
       (and
        (cons? (hd (tl (hd V473))))
        (and
         (= '__at__p (hd (hd (tl (hd V473)))))
         (and
          (cons? (tl (hd (tl (hd V473)))))
          (and
           (cons? (tl (tl (hd (tl (hd V473))))))
           (and
            (= () (tl (tl (tl (hd (tl (hd V473)))))))
            (and
             (cons? (tl (tl (hd V473))))
             (and
              (= () (tl (tl (tl (hd V473)))))
              (and (cons? (tl V473)) (= () (tl (tl V473)))))))))))))))
   (do
    (shen-add_test (cons 'tuple? (tl V473)))
    (let
     Abstraction
     (cons
      (intern "/.")
      (cons
       (hd (tl (hd (tl (hd V473)))))
       (cons
        (cons
         (intern "/.")
         (cons
          (hd (tl (tl (hd (tl (hd V473))))))
          (cons
           (shen-ebr
            (hd (tl V473))
            (hd (tl (hd V473)))
            (hd (tl (tl (hd V473)))))
           ())))
        ())))
     (let
      Application
      (cons
       (cons Abstraction (cons (cons 'fst (tl V473)) ()))
       (cons (cons 'snd (tl V473)) ()))
      (shen-reduce_help Application)))))
  ((and
    (cons? V473)
    (and
     (cons? (hd V473))
     (and
      (= (intern "/.") (hd (hd V473)))
      (and
       (cons? (tl (hd V473)))
       (and
        (cons? (hd (tl (hd V473))))
        (and
         (= '__at__v (hd (hd (tl (hd V473)))))
         (and
          (cons? (tl (hd (tl (hd V473)))))
          (and
           (cons? (tl (tl (hd (tl (hd V473))))))
           (and
            (= () (tl (tl (tl (hd (tl (hd V473)))))))
            (and
             (cons? (tl (tl (hd V473))))
             (and
              (= () (tl (tl (tl (hd V473)))))
              (and (cons? (tl V473)) (= () (tl (tl V473)))))))))))))))
   (do
    (shen-add_test (cons 'shen-+vector? (tl V473)))
    (let
     Abstraction
     (cons
      (intern "/.")
      (cons
       (hd (tl (hd (tl (hd V473)))))
       (cons
        (cons
         (intern "/.")
         (cons
          (hd (tl (tl (hd (tl (hd V473))))))
          (cons
           (shen-ebr
            (hd (tl V473))
            (hd (tl (hd V473)))
            (hd (tl (tl (hd V473)))))
           ())))
        ())))
     (let
      Application
      (cons
       (cons Abstraction (cons (cons 'hdv (tl V473)) ()))
       (cons (cons 'tlv (tl V473)) ()))
      (shen-reduce_help Application)))))
  ((and
    (cons? V473)
    (and
     (cons? (hd V473))
     (and
      (= (intern "/.") (hd (hd V473)))
      (and
       (cons? (tl (hd V473)))
       (and
        (cons? (hd (tl (hd V473))))
        (and
         (= '__at__s (hd (hd (tl (hd V473)))))
         (and
          (cons? (tl (hd (tl (hd V473)))))
          (and
           (cons? (tl (tl (hd (tl (hd V473))))))
           (and
            (= () (tl (tl (tl (hd (tl (hd V473)))))))
            (and
             (cons? (tl (tl (hd V473))))
             (and
              (= () (tl (tl (tl (hd V473)))))
              (and (cons? (tl V473)) (= () (tl (tl V473)))))))))))))))
   (do
    (shen-add_test (cons 'shen-+string? (tl V473)))
    (let
     Abstraction
     (cons
      (intern "/.")
      (cons
       (hd (tl (hd (tl (hd V473)))))
       (cons
        (cons
         (intern "/.")
         (cons
          (hd (tl (tl (hd (tl (hd V473))))))
          (cons
           (shen-ebr
            (hd (tl V473))
            (hd (tl (hd V473)))
            (hd (tl (tl (hd V473)))))
           ())))
        ())))
     (let
      Application
      (cons
       (cons
        Abstraction
        (cons (cons 'pos (cons (hd (tl V473)) (cons 0 ()))) ()))
       (cons (cons 'tlstr (tl V473)) ()))
      (shen-reduce_help Application)))))
  ((and
    (cons? V473)
    (and
     (cons? (hd V473))
     (and
      (= (intern "/.") (hd (hd V473)))
      (and
       (cons? (tl (hd V473)))
       (and
        (cons? (tl (tl (hd V473))))
        (and
         (= () (tl (tl (tl (hd V473)))))
         (and
          (cons? (tl V473))
          (and
           (= () (tl (tl V473)))
           (not (variable? (hd (tl (hd V473)))))))))))))
   (do
    (shen-add_test (cons '= (cons (hd (tl (hd V473))) (tl V473))))
    (shen-reduce_help (hd (tl (tl (hd V473)))))))
  ((and
    (cons? V473)
    (and
     (cons? (hd V473))
     (and
      (= (intern "/.") (hd (hd V473)))
      (and
       (cons? (tl (hd V473)))
       (and
        (cons? (tl (tl (hd V473))))
        (and
         (= () (tl (tl (tl (hd V473)))))
         (and (cons? (tl V473)) (= () (tl (tl V473))))))))))
   (recur
    (shen-ebr
     (hd (tl V473))
     (hd (tl (hd V473)))
     (hd (tl (tl (hd V473)))))))
  ((and
    (cons? V473)
    (and
     (= 'where (hd V473))
     (and
      (cons? (tl V473))
      (and (cons? (tl (tl V473))) (= () (tl (tl (tl V473))))))))
   (do
    (shen-add_test (hd (tl V473)))
    (shen-reduce_help (hd (tl (tl V473))))))
  ((and (cons? V473) (and (cons? (tl V473)) (= () (tl (tl V473)))))
   (let
    Z
    (shen-reduce_help (hd V473))
    (if (= (hd V473) Z) V473 (shen-reduce_help (cons Z (tl V473))))))
  (true V473)))

(defun
 shen-+string?
 (V474)
 (cond ((= "" V474) false) (true (string? V474))))

(defun
 shen-+vector
 (V475)
 (cond ((= V475 (vector 0)) false) (true (vector? V475))))

(defun
 shen-ebr
 (V484 V485 V486)
 (cond
  ((= V486 V485) V484)
  ((and
    (cons? V486)
    (and
     (= (intern "/.") (hd V486))
     (and
      (cons? (tl V486))
      (and
       (cons? (tl (tl V486)))
       (and
        (= () (tl (tl (tl V486))))
        (> (occurrences V485 (hd (tl V486))) 0))))))
   V486)
  ((and
    (cons? V486)
    (and
     (= 'let (hd V486))
     (and
      (cons? (tl V486))
      (and
       (cons? (tl (tl V486)))
       (and
        (cons? (tl (tl (tl V486))))
        (and
         (= () (tl (tl (tl (tl V486)))))
         (= (hd (tl V486)) V485)))))))
   (cons
    'let
    (cons
     (hd (tl V486))
     (cons
      (shen-ebr V484 (hd (tl V486)) (hd (tl (tl V486))))
      (tl (tl (tl V486)))))))
  ((cons? V486)
   (cons
    (shen-ebr V484 V485 (hd V486))
    (shen-ebr V484 V485 (tl V486))))
  (true V486)))

(defun
 shen-add_test
 (V489)
 (set 'shen-*teststack* (cons V489 (value 'shen-*teststack*))))

(defun
 shen-cond-expression
 (V490 V491 V492)
 (let
  Err
  (shen-err-condition V490)
  (let
   Cases
   (shen-case-form V492 Err)
   (let
    EncodeChoices
    (shen-encode-choices Cases V490)
    (shen-cond-form EncodeChoices)))))

(defun
 shen-cond-form
 (V495)
 (cond
  ((and
    (cons? V495)
    (and
     (cons? (hd V495))
     (and
      (= true (hd (hd V495)))
      (and (cons? (tl (hd V495))) (= () (tl (tl (hd V495))))))))
   (hd (tl (hd V495))))
  (true (cons 'cond V495))))

(defun
 shen-encode-choices
 (V498 V499)
 (cond
  ((= () V498) ())
  ((and
    (cons? V498)
    (and
     (cons? (hd V498))
     (and
      (= true (hd (hd V498)))
      (and
       (cons? (tl (hd V498)))
       (and
        (cons? (hd (tl (hd V498))))
        (and
         (= 'shen-choicepoint! (hd (hd (tl (hd V498)))))
         (and
          (cons? (tl (hd (tl (hd V498)))))
          (and
           (= () (tl (tl (hd (tl (hd V498))))))
           (and (= () (tl (tl (hd V498)))) (= () (tl V498)))))))))))
   (cons
    (cons
     true
     (cons
      (cons
       'let
       (cons
        'Result
        (cons
         (hd (tl (hd (tl (hd V498)))))
         (cons
          (cons
           'if
           (cons
            (cons '= (cons 'Result (cons (cons 'fail ()) ())))
            (cons
             (if
              (value 'shen-*installing-kl*)
              (cons 'shen-sys-error (cons V499 ()))
              (cons 'shen-f_error (cons V499 ())))
             (cons 'Result ()))))
          ()))))
      ()))
    ()))
  ((and
    (cons? V498)
    (and
     (cons? (hd V498))
     (and
      (= true (hd (hd V498)))
      (and
       (cons? (tl (hd V498)))
       (and
        (cons? (hd (tl (hd V498))))
        (and
         (= 'shen-choicepoint! (hd (hd (tl (hd V498)))))
         (and
          (cons? (tl (hd (tl (hd V498)))))
          (and
           (= () (tl (tl (hd (tl (hd V498))))))
           (= () (tl (tl (hd V498))))))))))))
   (cons
    (cons
     true
     (cons
      (cons
       'let
       (cons
        'Result
        (cons
         (hd (tl (hd (tl (hd V498)))))
         (cons
          (cons
           'if
           (cons
            (cons '= (cons 'Result (cons (cons 'fail ()) ())))
            (cons
             (shen-cond-form (shen-encode-choices (tl V498) V499))
             (cons 'Result ()))))
          ()))))
      ()))
    ()))
  ((and
    (cons? V498)
    (and
     (cons? (hd V498))
     (and
      (cons? (tl (hd V498)))
      (and
       (cons? (hd (tl (hd V498))))
       (and
        (= 'shen-choicepoint! (hd (hd (tl (hd V498)))))
        (and
         (cons? (tl (hd (tl (hd V498)))))
         (and
          (= () (tl (tl (hd (tl (hd V498))))))
          (= () (tl (tl (hd V498)))))))))))
   (cons
    (cons
     true
     (cons
      (cons
       'let
       (cons
        'Freeze
        (cons
         (cons
          'freeze
          (cons
           (shen-cond-form (shen-encode-choices (tl V498) V499))
           ()))
         (cons
          (cons
           'if
           (cons
            (hd (hd V498))
            (cons
             (cons
              'let
              (cons
               'Result
               (cons
                (hd (tl (hd (tl (hd V498)))))
                (cons
                 (cons
                  'if
                  (cons
                   (cons '= (cons 'Result (cons (cons 'fail ()) ())))
                   (cons
                    (cons 'thaw (cons 'Freeze ()))
                    (cons 'Result ()))))
                 ()))))
             (cons (cons 'thaw (cons 'Freeze ())) ()))))
          ()))))
      ()))
    ()))
  ((and
    (cons? V498)
    (and
     (cons? (hd V498))
     (and (cons? (tl (hd V498))) (= () (tl (tl (hd V498)))))))
   (cons (hd V498) (shen-encode-choices (tl V498) V499)))
  (true (shen-sys-error 'shen-encode-choices))))

(defun
 shen-case-form
 (V504 V505)
 (cond
  ((= () V504) (cons V505 ()))
  ((and
    (cons? V504)
    (and
     (cons? (hd V504))
     (and
      (cons? (hd (hd V504)))
      (and
       (= 'shen-tests (hd (hd (hd V504))))
       (and
        (= () (tl (hd (hd V504))))
        (and
         (cons? (tl (hd V504)))
         (and
          (cons? (hd (tl (hd V504))))
          (and
           (= 'shen-choicepoint! (hd (hd (tl (hd V504)))))
           (and
            (cons? (tl (hd (tl (hd V504)))))
            (and
             (= () (tl (tl (hd (tl (hd V504))))))
             (= () (tl (tl (hd V504))))))))))))))
   (cons (cons true (tl (hd V504))) (shen-case-form (tl V504) V505)))
  ((and
    (cons? V504)
    (and
     (cons? (hd V504))
     (and
      (cons? (hd (hd V504)))
      (and
       (= 'shen-tests (hd (hd (hd V504))))
       (and
        (= () (tl (hd (hd V504))))
        (and (cons? (tl (hd V504))) (= () (tl (tl (hd V504))))))))))
   (cons (cons true (tl (hd V504))) ()))
  ((and
    (cons? V504)
    (and
     (cons? (hd V504))
     (and
      (cons? (hd (hd V504)))
      (and
       (= 'shen-tests (hd (hd (hd V504))))
       (and (cons? (tl (hd V504))) (= () (tl (tl (hd V504)))))))))
   (cons
    (cons (shen-embed-and (tl (hd (hd V504)))) (tl (hd V504)))
    (shen-case-form (tl V504) V505)))
  (true (shen-sys-error 'shen-case-form))))

(defun
 shen-embed-and
 (V506)
 (cond
  ((and (cons? V506) (= () (tl V506))) (hd V506))
  ((cons? V506)
   (cons 'and (cons (hd V506) (cons (shen-embed-and (tl V506)) ()))))
  (true (shen-sys-error 'shen-embed-and))))

(defun
 shen-err-condition
 (V507)
 (cond
  ((value 'shen-*installing-kl*)
   (cons true (cons (cons 'shen-sys-error (cons V507 ())) ())))
  (true (cons true (cons (cons 'shen-f_error (cons V507 ())) ())))))

(defun
 shen-sys-error
 (V508)
 (interror
  "system function ~A: unexpected argument~%"
  (__at__p V508 ())))

(clojure.core/comment "klambda/load.kl")

(defun
 load
 (V1607)
 (let
  Load
  (let
   Start
   (get-time 'run)
   (let
    Result
    (shen-load-help (value 'shen-*tc*) (read-file V1607))
    (let
     Finish
     (get-time 'run)
     (let
      Time
      (- Finish Start)
      (let
       Message
       (intoutput "~%run time: ~A secs~%" (__at__p Time ()))
       Result)))))
  (let
   Infs
   (if
    (value 'shen-*tc*)
    (intoutput
     "~%typechecked in ~A inferences~%"
     (__at__p (inferences '_) ()))
    'shen-skip)
   'loaded)))

(defun
 shen-load-help
 (V1612 V1613)
 (cond
  ((= false V1612)
   (map
    (lambda X (intoutput "~S~%" (__at__p (eval-without-macros X) ())))
    V1613))
  (true
   (let
    RemoveSynonyms
    (mapcan (lambda V1614 (shen-remove-synonyms V1614)) V1613)
    (let
     Table
     (mapcan (lambda V1615 (shen-typetable V1615)) RemoveSynonyms)
     (let
      Assume
      (map (lambda V1616 (shen-assumetype V1616)) Table)
      (trap-error
       (map
        (lambda V1617 (shen-typecheck-and-load V1617))
        RemoveSynonyms)
       (lambda E (shen-unwind-types E Table)))))))))

(defun
 shen-remove-synonyms
 (V1618)
 (cond
  ((and (cons? V1618) (= 'shen-synonyms-help (hd V1618)))
   (do (eval V1618) ()))
  (true (cons V1618 ()))))

(defun
 shen-typecheck-and-load
 (V1619)
 (do (nl 1) (shen-typecheck-and-evaluate V1619 (gensym 'A))))

(defun
 shen-typetable
 (V1624)
 (cond
  ((and (cons? V1624) (and (= 'define (hd V1624)) (cons? (tl V1624))))
   (let
    Sig
    (compile (lambda V1625 (shen-<sig+rest> V1625)) (tl (tl V1624)) ())
    (if
     (= Sig 'fail!)
     (interror
      "~A lacks a proper signature.~%"
      (__at__p (hd (tl V1624)) ()))
     (cons (cons (hd (tl V1624)) Sig) ()))))
  (true ())))

(defun
 shen-assumetype
 (V1626)
 (cond
  ((cons? V1626) (declare (hd V1626) (tl V1626)))
  (true (shen-sys-error 'shen-assumetype))))

(defun
 shen-unwind-types
 (V1631 V1632)
 (cond
  ((= () V1632) (simple-error (error-to-string V1631)))
  ((and (cons? V1632) (cons? (hd V1632)))
   (do
    (shen-remtype (hd (hd V1632)))
    (shen-unwind-types V1631 (tl V1632))))
  (true (shen-sys-error 'shen-unwind-types))))

(defun
 shen-remtype
 (V1633)
 (do
  (set 'shen-*signedfuncs* (remove V1633 (value 'shen-*signedfuncs*)))
  V1633))

(defun
 shen-<sig+rest>
 (V1634)
 (let
  Result
  (let
   Parse_<signature>
   (shen-<signature> V1634)
   (if
    (not (= (fail) Parse_<signature>))
    (let
     Parse_<any>
     (shen-<any> Parse_<signature>)
     (if
      (not (= (fail) Parse_<any>))
      (shen-reassemble (fst Parse_<any>) (snd Parse_<signature>))
      (fail)))
    (fail)))
  (if (= Result (fail)) (fail) Result)))

(defun
 dump
 (V1635 V1636)
 (let
  Shen
  (read-file V1635)
  (let
   KL
   (map (lambda V1637 (shen-shen-out V1637)) Shen)
   (let
    ObjectFile
    (cn V1635 (cn "." V1636))
    (let
     Stream
     (open 'file ObjectFile 'out)
     (let
      Dump
      (shen-dump-target Stream V1636 KL)
      (let Close (close Stream) ObjectFile)))))))

(defun
 shen-shen-out
 (V1638)
 (cond
  ((and (cons? V1638) (and (= 'define (hd V1638)) (cons? (tl V1638))))
   (shen-shen->kl (hd (tl V1638)) (tl (tl V1638))))
  (true V1638)))

(defun
 shen-dump-target
 (V1647 V1648 V1649)
 (cond
  ((= "kl" V1648) (shen-write-object-code-to-file V1647 V1649))
  ((= "cl" V1648)
   (shen-write-object-code-to-file
    V1647
    (map (lambda X (shen-kl-to-lisp () X)) V1649)))
  (true
   (interror "~A is not known as a platform~%" (__at__p V1648 ())))))

(defun
 shen-write-object-code-to-file
 (V1650 V1651)
 (map
  (lambda
   X
   (let
    String
    (intmake-string "~R~%~%" (__at__p X ()))
    (pr String V1650)))
  V1651))

(defun
 write-to-file
 (V1652 V1653)
 (let
  AbsPath
  (intmake-string
   "~A~A"
   (__at__p (value '*home-directory*) (__at__p V1652 ())))
  (let
   Stream
   (open 'file AbsPath 'out)
   (let
    String
    (intmake-string "~S~%~%" (__at__p V1653 ()))
    (let Write (pr String Stream) (let Close (close Stream) V1653))))))

(clojure.core/comment "klambda/macros.kl")

(defun macroexpand (V509) (shen-compose (value '*macros*) V509))

(defun
 macroexpand
 (V510)
 (let
  Y
  (shen-compose (value '*macros*) V510)
  (if (= V510 Y) V510 (shen-walk 'macroexpand Y))))

(set
 '*macros*
 (cons
  'shen-timer-macro
  (cons
   'shen-cases-macro
   (cons
    'shen-abs-macro
    (cons
     (intern "shen-put/get-macro")
     (cons
      'shen-compile-macro
      (cons
       'shen-yacc-macro
       (cons
        'shen-datatype-macro
        (cons
         'shen-let-macro
         (cons
          'shen-assoc-macro
          (cons
           (intern "shen-i/o-macro")
           (cons
            'shen-prolog-macro
            (cons
             'shen-synonyms-macro
             (cons
              'shen-nl-macro
              (cons
               'shen-vector-macro
               (cons
                'shen-__at__s-macro
                (cons
                 'shen-defmacro-macro
                 (cons
                  'shen-defprolog-macro
                  (cons 'shen-function-macro ())))))))))))))))))))

(defun
 shen-compose
 (V511 V512)
 (cond
  ((= () V511) V512)
  ((cons? V511) (recur (tl V511) ((function (hd V511)) V512)))
  (true (shen-sys-error 'shen-compose))))

(defun
 shen-compile-macro
 (V513)
 (cond
  ((and
    (cons? V513)
    (and
     (= 'compile (hd V513))
     (and
      (cons? (tl V513))
      (and (cons? (tl (tl V513))) (= () (tl (tl (tl V513))))))))
   (cons
    'compile
    (cons (hd (tl V513)) (cons (hd (tl (tl V513))) (cons () ())))))
  (true V513)))

(defun
 shen-prolog-macro
 (V514)
 (cond
  ((and (cons? V514) (= 'prolog? (hd V514)))
   (cons 'shen-intprolog (cons (shen-prolog-form (tl V514)) ())))
  (true V514)))

(defun
 shen-defprolog-macro
 (V515)
 (cond
  ((and (cons? V515) (and (= 'defprolog (hd V515)) (cons? (tl V515))))
   (compile
    (lambda V516 (shen-<defprolog> V516))
    (tl V515)
    (lambda Y (shen-prolog-error (hd (tl V515)) Y))))
  (true V515)))

(defun
 shen-prolog-form
 (V517)
 (shen-cons_form (map (lambda V518 (shen-cons_form V518)) V517)))

(defun
 shen-datatype-macro
 (V519)
 (cond
  ((and (cons? V519) (and (= 'datatype (hd V519)) (cons? (tl V519))))
   (cons
    'shen-process-datatype
    (cons
     (hd (tl V519))
     (cons
      (cons
       'compile
       (cons
        (cons 'function (cons 'shen-<datatype-rules> ()))
        (cons
         (shen-rcons_form (tl (tl V519)))
         (cons (cons 'function (cons 'shen-datatype-error ())) ()))))
      ()))))
  (true V519)))

(defun
 shen-defmacro-macro
 (V520)
 (cond
  ((and (cons? V520) (and (= 'defmacro (hd V520)) (cons? (tl V520))))
   (let
    Macro
    (compile 'shen-<defmacro> (tl V520) ())
    (let
     Declare
     (cons
      'do
      (cons
       (cons
        'set
        (cons
         '*macros*
         (cons
          (cons
           'adjoin
           (cons
            (hd (tl V520))
            (cons (cons 'value (cons '*macros* ())) ())))
          ())))
       (cons 'macro ())))
     (let
      Package
      (cons
       'package
       (cons 'null (cons () (cons Declare (cons Macro ())))))
      Package))))
  (true V520)))

(defun
 shen-defmacro-macro
 (V521)
 (cond
  ((and (cons? V521) (and (= 'defmacro (hd V521)) (cons? (tl V521))))
   (let
    Macro
    (cons
     'define
     (cons
      (hd (tl V521))
      (append (tl (tl V521)) (cons 'X (cons '-> (cons 'X ()))))))
    (let
     Declare
     (cons
      'do
      (cons
       (cons
        'set
        (cons
         '*macros*
         (cons
          (cons
           'adjoin
           (cons
            (hd (tl V521))
            (cons (cons 'value (cons '*macros* ())) ())))
          ())))
       (cons 'macro ())))
     (let
      Package
      (cons
       'package
       (cons 'null (cons () (cons Declare (cons Macro ())))))
      Package))))
  (true V521)))

(defun
 shen-<defmacro>
 (V522)
 (let
  Result
  (let
   Parse_<name>
   (shen-<name> V522)
   (if
    (not (= (fail) Parse_<name>))
    (let
     Parse_<macrorules>
     (shen-<macrorules> Parse_<name>)
     (if
      (not (= (fail) Parse_<macrorules>))
      (shen-reassemble
       (fst Parse_<macrorules>)
       (cons
        'define
        (cons (snd Parse_<name>) (snd Parse_<macrorules>))))
      (fail)))
    (fail)))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<macrorules>
 (V523)
 (let
  Result
  (let
   Parse_<macrorule>
   (shen-<macrorule> V523)
   (if
    (not (= (fail) Parse_<macrorule>))
    (let
     Parse_<macrorules>
     (shen-<macrorules> Parse_<macrorule>)
     (if
      (not (= (fail) Parse_<macrorules>))
      (shen-reassemble
       (fst Parse_<macrorules>)
       (append (snd Parse_<macrorule>) (snd Parse_<macrorules>)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<macrorule>
     (shen-<macrorule> V523)
     (if
      (not (= (fail) Parse_<macrorule>))
      (shen-reassemble
       (fst Parse_<macrorule>)
       (append
        (snd Parse_<macrorule>)
        (cons 'X (cons '-> (cons 'X ())))))
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<macrorule>
 (V524)
 (let
  Result
  (let
   Parse_<patterns>
   (shen-<patterns> V524)
   (if
    (not (= (fail) Parse_<patterns>))
    (if
     (and
      (cons? (fst Parse_<patterns>))
      (= '-> (hd (fst Parse_<patterns>))))
     (let
      Parse_<macroaction>
      (shen-<macroaction>
       (shen-reassemble
        (tl (fst Parse_<patterns>))
        (snd Parse_<patterns>)))
      (if
       (not (= (fail) Parse_<macroaction>))
       (if
        (and
         (cons? (fst Parse_<macroaction>))
         (= 'where (hd (fst Parse_<macroaction>))))
        (let
         Parse_<guard>
         (shen-<guard>
          (shen-reassemble
           (tl (fst Parse_<macroaction>))
           (snd Parse_<macroaction>)))
         (if
          (not (= (fail) Parse_<guard>))
          (shen-reassemble
           (fst Parse_<guard>)
           (append
            (snd Parse_<patterns>)
            (cons
             '->
             (append
              (snd Parse_<macroaction>)
              (cons 'where (snd Parse_<guard>))))))
          (fail)))
        (fail))
       (fail)))
     (fail))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<patterns>
     (shen-<patterns> V524)
     (if
      (not (= (fail) Parse_<patterns>))
      (if
       (and
        (cons? (fst Parse_<patterns>))
        (= '-> (hd (fst Parse_<patterns>))))
       (let
        Parse_<macroaction>
        (shen-<macroaction>
         (shen-reassemble
          (tl (fst Parse_<patterns>))
          (snd Parse_<patterns>)))
        (if
         (not (= (fail) Parse_<macroaction>))
         (shen-reassemble
          (fst Parse_<macroaction>)
          (append
           (snd Parse_<patterns>)
           (cons '-> (snd Parse_<macroaction>))))
         (fail)))
       (fail))
      (fail)))
    (if
     (= Result (fail))
     (let
      Result
      (let
       Parse_<patterns>
       (shen-<patterns> V524)
       (if
        (not (= (fail) Parse_<patterns>))
        (if
         (and
          (cons? (fst Parse_<patterns>))
          (= '<- (hd (fst Parse_<patterns>))))
         (let
          Parse_<macroaction>
          (shen-<macroaction>
           (shen-reassemble
            (tl (fst Parse_<patterns>))
            (snd Parse_<patterns>)))
          (if
           (not (= (fail) Parse_<macroaction>))
           (if
            (and
             (cons? (fst Parse_<macroaction>))
             (= 'where (hd (fst Parse_<macroaction>))))
            (let
             Parse_<guard>
             (shen-<guard>
              (shen-reassemble
               (tl (fst Parse_<macroaction>))
               (snd Parse_<macroaction>)))
             (if
              (not (= (fail) Parse_<guard>))
              (shen-reassemble
               (fst Parse_<guard>)
               (append
                (snd Parse_<patterns>)
                (cons
                 '<-
                 (append
                  (snd Parse_<macroaction>)
                  (cons 'where (snd Parse_<guard>))))))
              (fail)))
            (fail))
           (fail)))
         (fail))
        (fail)))
      (if
       (= Result (fail))
       (let
        Result
        (let
         Parse_<patterns>
         (shen-<patterns> V524)
         (if
          (not (= (fail) Parse_<patterns>))
          (if
           (and
            (cons? (fst Parse_<patterns>))
            (= '<- (hd (fst Parse_<patterns>))))
           (let
            Parse_<macroaction>
            (shen-<macroaction>
             (shen-reassemble
              (tl (fst Parse_<patterns>))
              (snd Parse_<patterns>)))
            (if
             (not (= (fail) Parse_<macroaction>))
             (shen-reassemble
              (fst Parse_<macroaction>)
              (append
               (snd Parse_<patterns>)
               (cons '<- (snd Parse_<macroaction>))))
             (fail)))
           (fail))
          (fail)))
        (if (= Result (fail)) (fail) Result))
       Result))
     Result))
   Result)))

(defun
 shen-<macroaction>
 (V525)
 (let
  Result
  (let
   Parse_<action>
   (shen-<action> V525)
   (if
    (not (= (fail) Parse_<action>))
    (shen-reassemble
     (fst Parse_<action>)
     (cons
      (cons
       'shen-walk
       (cons
        (cons 'function (cons 'macroexpand ()))
        (cons (snd Parse_<action>) ())))
      ()))
    (fail)))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-__at__s-macro
 (V526)
 (cond
  ((and
    (cons? V526)
    (and
     (= '__at__s (hd V526))
     (and
      (cons? (tl V526))
      (and (cons? (tl (tl V526))) (cons? (tl (tl (tl V526))))))))
   (cons
    '__at__s
    (cons
     (hd (tl V526))
     (cons (shen-__at__s-macro (cons '__at__s (tl (tl V526)))) ()))))
  ((and
    (cons? V526)
    (and
     (= '__at__s (hd V526))
     (and
      (cons? (tl V526))
      (and
       (cons? (tl (tl V526)))
       (and (= () (tl (tl (tl V526)))) (string? (hd (tl V526))))))))
   (let
    E
    (explode (hd (tl V526)))
    (if
     (> (length E) 1)
     (shen-__at__s-macro (cons '__at__s (append E (tl (tl V526)))))
     V526)))
  (true V526)))

(defun
 shen-synonyms-macro
 (V527)
 (cond
  ((and (cons? V527) (= 'synonyms (hd V527)))
   (cons 'shen-synonyms-help (cons (shen-rcons_form (tl V527)) ())))
  (true V527)))

(defun
 shen-nl-macro
 (V528)
 (cond
  ((and (cons? V528) (and (= 'nl (hd V528)) (= () (tl V528))))
   (cons 'nl (cons 1 ())))
  (true V528)))

(defun
 shen-vector-macro
 (V529)
 (cond ((= '<> V529) (cons 'vector (cons 0 ()))) (true V529)))

(defun
 shen-yacc-macro
 (V530)
 (cond
  ((and (cons? V530) (and (= 'defcc (hd V530)) (cons? (tl V530))))
   (shen-yacc->shen (hd (tl V530)) (tl (tl V530))))
  (true V530)))

(defun
 shen-assoc-macro
 (V531)
 (cond
  ((and
    (cons? V531)
    (and
     (cons? (tl V531))
     (and
      (cons? (tl (tl V531)))
      (and
       (cons? (tl (tl (tl V531))))
       (element?
        (hd V531)
        (cons
         '__at__p
         (cons
          '__at__v
          (cons
           'append
           (cons
            'and
            (cons 'or (cons '+ (cons '* (cons 'do ())))))))))))))
   (cons
    (hd V531)
    (cons
     (hd (tl V531))
     (cons (shen-assoc-macro (cons (hd V531) (tl (tl V531)))) ()))))
  (true V531)))

(defun
 shen-let-macro
 (V532)
 (cond
  ((and
    (cons? V532)
    (and
     (= 'let (hd V532))
     (and
      (cons? (tl V532))
      (and
       (cons? (tl (tl V532)))
       (and
        (cons? (tl (tl (tl V532))))
        (cons? (tl (tl (tl (tl V532))))))))))
   (cons
    'let
    (cons
     (hd (tl V532))
     (cons
      (hd (tl (tl V532)))
      (cons (shen-let-macro (cons 'let (tl (tl (tl V532))))) ())))))
  (true V532)))

(defun
 shen-abs-macro
 (V533)
 (cond
  ((and
    (cons? V533)
    (and
     (= (intern "/.") (hd V533))
     (and
      (cons? (tl V533))
      (and (cons? (tl (tl V533))) (cons? (tl (tl (tl V533))))))))
   (cons
    'lambda
    (cons
     (hd (tl V533))
     (cons (shen-abs-macro (cons (intern "/.") (tl (tl V533)))) ()))))
  ((and
    (cons? V533)
    (and
     (= (intern "/.") (hd V533))
     (and
      (cons? (tl V533))
      (and (cons? (tl (tl V533))) (= () (tl (tl (tl V533))))))))
   (cons 'lambda (tl V533)))
  (true V533)))

(defun
 shen-cases-macro
 (V536)
 (cond
  ((and
    (cons? V536)
    (and
     (= 'cases (hd V536))
     (and
      (cons? (tl V536))
      (and (= true (hd (tl V536))) (cons? (tl (tl V536)))))))
   (hd (tl (tl V536))))
  ((and
    (cons? V536)
    (and
     (= 'cases (hd V536))
     (and
      (cons? (tl V536))
      (and (cons? (tl (tl V536))) (= () (tl (tl (tl V536))))))))
   (cons
    'if
    (cons
     (hd (tl V536))
     (cons
      (hd (tl (tl V536)))
      (cons
       ((function (intern "shen-i/o-macro"))
        (cons 'error (cons "error: cases exhausted~%" ())))
       ())))))
  ((and
    (cons? V536)
    (and
     (= 'cases (hd V536))
     (and (cons? (tl V536)) (cons? (tl (tl V536))))))
   (cons
    'if
    (cons
     (hd (tl V536))
     (cons
      (hd (tl (tl V536)))
      (cons
       (shen-cases-macro (cons 'cases (tl (tl (tl V536)))))
       ())))))
  ((and
    (cons? V536)
    (and
     (= 'cases (hd V536))
     (and (cons? (tl V536)) (= () (tl (tl V536))))))
   (interror "error: odd number of case elements~%" ()))
  (true V536)))

(defun
 shen-timer-macro
 (V537)
 (cond
  ((and
    (cons? V537)
    (and
     (= 'time (hd V537))
     (and (cons? (tl V537)) (= () (tl (tl V537))))))
   (shen-let-macro
    (cons
     'let
     (cons
      'Start
      (cons
       (cons 'get-time (cons 'run ()))
       (cons
        'Result
        (cons
         (hd (tl V537))
         (cons
          'Finish
          (cons
           (cons 'get-time (cons 'run ()))
           (cons
            'Time
            (cons
             (cons '- (cons 'Finish (cons 'Start ())))
             (cons
              'Message
              (cons
               ((function (intern "shen-i/o-macro"))
                (cons
                 'output
                 (cons "~%run time: ~A secs~%" (cons 'Time ()))))
               (cons 'Result ()))))))))))))))
  (true V537)))

(defun
 (intern "shen-i/o-macro")
 (V538)
 (cond
  ((and (cons? V538) (and (= 'output (hd V538)) (cons? (tl V538))))
   (cons
    'intoutput
    (cons (hd (tl V538)) (cons (shen-tuple-up (tl (tl V538))) ()))))
  ((and
    (cons? V538)
    (and (= 'make-string (hd V538)) (cons? (tl V538))))
   (cons
    'intmake-string
    (cons (hd (tl V538)) (cons (shen-tuple-up (tl (tl V538))) ()))))
  ((and (cons? V538) (and (= 'error (hd V538)) (cons? (tl V538))))
   (cons
    'interror
    (cons (hd (tl V538)) (cons (shen-tuple-up (tl (tl V538))) ()))))
  ((and
    (cons? V538)
    (and
     (= 'pr (hd V538))
     (and (cons? (tl V538)) (= () (tl (tl V538))))))
   (cons
    'pr
    (cons (hd (tl V538)) (cons (cons 'stinput (cons 0 ())) ()))))
  ((and (cons? V538) (and (= 'read-byte (hd V538)) (= () (tl V538))))
   (cons 'read-byte (cons (cons 'stinput (cons 0 ())) ())))
  (true V538)))

(defun
 shen-tuple-up
 (V539)
 (cond
  ((cons? V539)
   (cons
    '__at__p
    (cons (hd V539) (cons (shen-tuple-up (tl V539)) ()))))
  (true V539)))

(defun
 (intern "shen-put/get-macro")
 (V540)
 (cond
  ((and
    (cons? V540)
    (and
     (= 'put (hd V540))
     (and
      (cons? (tl V540))
      (and
       (cons? (tl (tl V540)))
       (and
        (cons? (tl (tl (tl V540))))
        (= () (tl (tl (tl (tl V540))))))))))
   (cons
    'put
    (cons
     (hd (tl V540))
     (cons
      (hd (tl (tl V540)))
      (cons
       (hd (tl (tl (tl V540))))
       (cons (cons 'value (cons 'shen-*property-vector* ())) ()))))))
  ((and
    (cons? V540)
    (and
     (= 'get (hd V540))
     (and
      (cons? (tl V540))
      (and (cons? (tl (tl V540))) (= () (tl (tl (tl V540))))))))
   (cons
    'get
    (cons
     (hd (tl V540))
     (cons
      (hd (tl (tl V540)))
      (cons (cons 'value (cons 'shen-*property-vector* ())) ())))))
  (true V540)))

(defun
 shen-function-macro
 (V541)
 (cond
  ((and
    (cons? V541)
    (and
     (= 'function (hd V541))
     (and (cons? (tl V541)) (= () (tl (tl V541))))))
   (shen-function-abstraction (hd (tl V541)) (arity (hd (tl V541)))))
  (true V541)))

(defun
 shen-function-abstraction
 (V542 V543)
 (cond
  ((= 0 V543) (cons 'freeze (cons V542 ())))
  ((= -1 V543) V542)
  (true (shen-function-abstraction-help V542 V543 ()))))

(defun
 shen-function-abstraction-help
 (V544 V545 V546)
 (cond
  ((= 0 V545) (cons V544 V546))
  (true
   (let
    X
    (gensym 'V)
    (cons
     (intern "/.")
     (cons
      X
      (cons
       (shen-function-abstraction-help
        V544
        (- V545 1)
        (append V546 (cons X ())))
       ())))))))

(clojure.core/comment "klambda/prolog.kl")

(defun
 shen-<defprolog>
 (V1127)
 (let
  Result
  (let
   Parse_<predicate*>
   (shen-<predicate*> V1127)
   (if
    (not (= (fail) Parse_<predicate*>))
    (let
     Parse_<clauses*>
     (shen-<clauses*> Parse_<predicate*>)
     (if
      (not (= (fail) Parse_<clauses*>))
      (shen-reassemble
       (fst Parse_<clauses*>)
       (hd
        (shen-prolog->shen
         (map
          (lambda X (shen-insert-predicate (snd Parse_<predicate*>) X))
          (snd Parse_<clauses*>)))))
      (fail)))
    (fail)))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-prolog-error
 (V1128 V1129)
 (interror
  "prolog syntax error in ~A here:~%~% ~A~%"
  (__at__p V1128 (__at__p (shen-next-50 50 V1129) ()))))

(defun
 shen-next-50
 (V1134 V1135)
 (cond
  ((= () V1135) "")
  ((= 0 V1134) "")
  ((cons? V1135)
   (cn
    (shen-decons-string (hd V1135))
    (shen-next-50 (- V1134 1) (tl V1135))))
  (true (shen-sys-error 'shen-next-50))))

(defun
 shen-decons-string
 (V1136)
 (cond
  ((and
    (cons? V1136)
    (and
     (= 'cons (hd V1136))
     (and
      (cons? (tl V1136))
      (and (cons? (tl (tl V1136))) (= () (tl (tl (tl V1136))))))))
   (intmake-string "~S " (__at__p (shen-eval-cons V1136) ())))
  (true (intmake-string "~R " (__at__p V1136 ())))))

(defun
 shen-insert-predicate
 (V1137 V1138)
 (cond
  ((and (cons? V1138) (and (cons? (tl V1138)) (= () (tl (tl V1138)))))
   (cons (cons V1137 (hd V1138)) (cons (intern ":-") (tl V1138))))
  (true (shen-sys-error 'shen-insert-predicate))))

(defun
 shen-<predicate*>
 (V1139)
 (let
  Result
  (if
   (cons? (fst V1139))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V1139)) (snd V1139)))
    (hd (fst V1139)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<clauses*>
 (V1140)
 (let
  Result
  (let
   Parse_<clause*>
   (shen-<clause*> V1140)
   (if
    (not (= (fail) Parse_<clause*>))
    (let
     Parse_<clauses*>
     (shen-<clauses*> Parse_<clause*>)
     (if
      (not (= (fail) Parse_<clauses*>))
      (shen-reassemble
       (fst Parse_<clauses*>)
       (cons (snd Parse_<clause*>) (snd Parse_<clauses*>)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<e>
     (<e> V1140)
     (if
      (not (= (fail) Parse_<e>))
      (shen-reassemble (fst Parse_<e>) (snd Parse_<e>))
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<clause*>
 (V1141)
 (let
  Result
  (let
   Parse_<head*>
   (shen-<head*> V1141)
   (if
    (not (= (fail) Parse_<head*>))
    (if
     (and
      (cons? (fst Parse_<head*>))
      (= '<-- (hd (fst Parse_<head*>))))
     (let
      Parse_<body*>
      (shen-<body*>
       (shen-reassemble (tl (fst Parse_<head*>)) (snd Parse_<head*>)))
      (if
       (not (= (fail) Parse_<body*>))
       (let
        Parse_<end*>
        (shen-<end*> Parse_<body*>)
        (if
         (not (= (fail) Parse_<end*>))
         (shen-reassemble
          (fst Parse_<end*>)
          (cons (snd Parse_<head*>) (cons (snd Parse_<body*>) ())))
         (fail)))
       (fail)))
     (fail))
    (fail)))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<head*>
 (V1142)
 (let
  Result
  (let
   Parse_<term*>
   (shen-<term*> V1142)
   (if
    (not (= (fail) Parse_<term*>))
    (let
     Parse_<head*>
     (shen-<head*> Parse_<term*>)
     (if
      (not (= (fail) Parse_<head*>))
      (shen-reassemble
       (fst Parse_<head*>)
       (cons (snd Parse_<term*>) (snd Parse_<head*>)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<e>
     (<e> V1142)
     (if
      (not (= (fail) Parse_<e>))
      (shen-reassemble (fst Parse_<e>) (snd Parse_<e>))
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<term*>
 (V1143)
 (let
  Result
  (if
   (cons? (fst V1143))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V1143)) (snd V1143)))
    (if
     (and
      (not (= '<-- (hd (fst V1143))))
      (shen-legitimate-term? (hd (fst V1143))))
     (shen-eval-cons (hd (fst V1143)))
     (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-legitimate-term?
 (V1148)
 (cond
  ((and
    (cons? V1148)
    (and
     (= 'cons (hd V1148))
     (and
      (cons? (tl V1148))
      (and (cons? (tl (tl V1148))) (= () (tl (tl (tl V1148))))))))
   (and
    (shen-legitimate-term? (hd (tl V1148)))
    (shen-legitimate-term? (hd (tl (tl V1148))))))
  ((and
    (cons? V1148)
    (and
     (= 'mode (hd V1148))
     (and
      (cons? (tl V1148))
      (and
       (cons? (tl (tl V1148)))
       (and
        (= '+ (hd (tl (tl V1148))))
        (= () (tl (tl (tl V1148)))))))))
   (recur (hd (tl V1148))))
  ((and
    (cons? V1148)
    (and
     (= 'mode (hd V1148))
     (and
      (cons? (tl V1148))
      (and
       (cons? (tl (tl V1148)))
       (and
        (= '- (hd (tl (tl V1148))))
        (= () (tl (tl (tl V1148)))))))))
   (recur (hd (tl V1148))))
  ((cons? V1148) false)
  (true true)))

(defun
 shen-eval-cons
 (V1149)
 (cond
  ((and
    (cons? V1149)
    (and
     (= 'cons (hd V1149))
     (and
      (cons? (tl V1149))
      (and (cons? (tl (tl V1149))) (= () (tl (tl (tl V1149))))))))
   (cons
    (shen-eval-cons (hd (tl V1149)))
    (shen-eval-cons (hd (tl (tl V1149))))))
  ((and
    (cons? V1149)
    (and
     (= 'mode (hd V1149))
     (and
      (cons? (tl V1149))
      (and (cons? (tl (tl V1149))) (= () (tl (tl (tl V1149))))))))
   (cons
    'mode
    (cons (shen-eval-cons (hd (tl V1149))) (tl (tl V1149)))))
  (true V1149)))

(defun
 shen-<body*>
 (V1150)
 (let
  Result
  (let
   Parse_<literal*>
   (shen-<literal*> V1150)
   (if
    (not (= (fail) Parse_<literal*>))
    (let
     Parse_<body*>
     (shen-<body*> Parse_<literal*>)
     (if
      (not (= (fail) Parse_<body*>))
      (shen-reassemble
       (fst Parse_<body*>)
       (cons (snd Parse_<literal*>) (snd Parse_<body*>)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<e>
     (<e> V1150)
     (if
      (not (= (fail) Parse_<e>))
      (shen-reassemble (fst Parse_<e>) (snd Parse_<e>))
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<literal*>
 (V1151)
 (let
  Result
  (if
   (and (cons? (fst V1151)) (= '! (hd (fst V1151))))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V1151)) (snd V1151)))
    (cons 'cut (cons 'Throwcontrol ())))
   (fail))
  (if
   (= Result (fail))
   (let
    Result
    (if
     (cons? (fst V1151))
     (shen-reassemble
      (fst (shen-reassemble (tl (fst V1151)) (snd V1151)))
      (if (cons? (hd (fst V1151))) (hd (fst V1151)) (fail)))
     (fail))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<end*>
 (V1152)
 (let
  Result
  (if
   (cons? (fst V1152))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V1152)) (snd V1152)))
    (if (= (hd (fst V1152)) (intern ";")) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 cut
 (V1153 V1154 V1155)
 (let Result (thaw V1155) (if (= Result false) V1153 Result)))

(defun
 shen-insert_modes
 (V1156)
 (cond
  ((and
    (cons? V1156)
    (and
     (= 'mode (hd V1156))
     (and
      (cons? (tl V1156))
      (and (cons? (tl (tl V1156))) (= () (tl (tl (tl V1156))))))))
   V1156)
  ((= () V1156) ())
  ((cons? V1156)
   (cons
    (cons 'mode (cons (hd V1156) (cons '+ ())))
    (cons 'mode (cons (shen-insert_modes (tl V1156)) (cons '- ())))))
  (true V1156)))

(defun
 shen-s-prolog
 (V1157)
 (map (lambda V1158 (eval V1158)) (shen-prolog->shen V1157)))

(defun
 shen-prolog->shen
 (V1159)
 (map
  (lambda V1160 (shen-compile_prolog_procedure V1160))
  (shen-group_clauses
   (map
    (lambda V1161 (shen-s-prolog_clause V1161))
    (mapcan (lambda V1162 (shen-head_abstraction V1162)) V1159)))))

(defun
 shen-s-prolog_clause
 (V1163)
 (cond
  ((and
    (cons? V1163)
    (and
     (cons? (tl V1163))
     (and
      (= (intern ":-") (hd (tl V1163)))
      (and (cons? (tl (tl V1163))) (= () (tl (tl (tl V1163))))))))
   (cons
    (hd V1163)
    (cons
     (intern ":-")
     (cons
      (map
       (lambda V1164 (shen-s-prolog_literal V1164))
       (hd (tl (tl V1163))))
      ()))))
  (true (shen-sys-error 'shen-s-prolog_clause))))

(defun
 shen-head_abstraction
 (V1165)
 (cond
  ((and
    (cons? V1165)
    (and
     (cons? (tl V1165))
     (and
      (= (intern ":-") (hd (tl V1165)))
      (and
       (cons? (tl (tl V1165)))
       (and
        (= () (tl (tl (tl V1165))))
        (<
         (shen-complexity_head (hd V1165))
         (value 'shen-*maxcomplexity*)))))))
   (cons V1165 ()))
  ((and
    (cons? V1165)
    (and
     (cons? (hd V1165))
     (and
      (cons? (tl V1165))
      (and
       (= (intern ":-") (hd (tl V1165)))
       (and (cons? (tl (tl V1165))) (= () (tl (tl (tl V1165)))))))))
   (let
    Terms
    (map (lambda Y (gensym 'V)) (tl (hd V1165)))
    (let
     XTerms
     (shen-rcons_form (shen-remove_modes (tl (hd V1165))))
     (let
      Literal
      (cons 'unify (cons (shen-cons_form Terms) (cons XTerms ())))
      (let
       Clause
       (cons
        (cons (hd (hd V1165)) Terms)
        (cons
         (intern ":-")
         (cons (cons Literal (hd (tl (tl V1165)))) ())))
       (cons Clause ()))))))
  (true (shen-sys-error 'shen-head_abstraction))))

(defun
 shen-complexity_head
 (V1170)
 (cond
  ((cons? V1170)
   (shen-product
    (map (lambda V1171 (shen-complexity V1171)) (tl V1170))))
  (true (shen-sys-error 'shen-complexity_head))))

(defun
 shen-complexity
 (V1179)
 (cond
  ((and
    (cons? V1179)
    (and
     (= 'mode (hd V1179))
     (and
      (cons? (tl V1179))
      (and
       (cons? (hd (tl V1179)))
       (and
        (= 'mode (hd (hd (tl V1179))))
        (and
         (cons? (tl (hd (tl V1179))))
         (and
          (cons? (tl (tl (hd (tl V1179)))))
          (and
           (= () (tl (tl (tl (hd (tl V1179))))))
           (and
            (cons? (tl (tl V1179)))
            (= () (tl (tl (tl V1179)))))))))))))
   (recur (hd (tl V1179))))
  ((and
    (cons? V1179)
    (and
     (= 'mode (hd V1179))
     (and
      (cons? (tl V1179))
      (and
       (cons? (hd (tl V1179)))
       (and
        (cons? (tl (tl V1179)))
        (and
         (= '+ (hd (tl (tl V1179))))
         (= () (tl (tl (tl V1179))))))))))
   (*
    2
    (*
     (shen-complexity
      (cons 'mode (cons (hd (hd (tl V1179))) (tl (tl V1179)))))
     (shen-complexity
      (cons 'mode (cons (tl (hd (tl V1179))) (tl (tl V1179))))))))
  ((and
    (cons? V1179)
    (and
     (= 'mode (hd V1179))
     (and
      (cons? (tl V1179))
      (and
       (cons? (hd (tl V1179)))
       (and
        (cons? (tl (tl V1179)))
        (and
         (= '- (hd (tl (tl V1179))))
         (= () (tl (tl (tl V1179))))))))))
   (*
    (shen-complexity
     (cons 'mode (cons (hd (hd (tl V1179))) (tl (tl V1179)))))
    (shen-complexity
     (cons 'mode (cons (tl (hd (tl V1179))) (tl (tl V1179)))))))
  ((and
    (cons? V1179)
    (and
     (= 'mode (hd V1179))
     (and
      (cons? (tl V1179))
      (and
       (cons? (tl (tl V1179)))
       (and
        (= () (tl (tl (tl V1179))))
        (variable? (hd (tl V1179))))))))
   1)
  ((and
    (cons? V1179)
    (and
     (= 'mode (hd V1179))
     (and
      (cons? (tl V1179))
      (and
       (cons? (tl (tl V1179)))
       (and
        (= '+ (hd (tl (tl V1179))))
        (= () (tl (tl (tl V1179)))))))))
   2)
  ((and
    (cons? V1179)
    (and
     (= 'mode (hd V1179))
     (and
      (cons? (tl V1179))
      (and
       (cons? (tl (tl V1179)))
       (and
        (= '- (hd (tl (tl V1179))))
        (= () (tl (tl (tl V1179)))))))))
   1)
  (true (recur (cons 'mode (cons V1179 (cons '+ ())))))))

(defun
 shen-product
 (V1180)
 (cond
  ((= () V1180) 1)
  ((cons? V1180) (* (hd V1180) (shen-product (tl V1180))))
  (true (shen-sys-error 'shen-product))))

(defun
 shen-s-prolog_literal
 (V1181)
 (cond
  ((and
    (cons? V1181)
    (and
     (= 'is (hd V1181))
     (and
      (cons? (tl V1181))
      (and (cons? (tl (tl V1181))) (= () (tl (tl (tl V1181))))))))
   (cons
    'bind
    (cons
     (hd (tl V1181))
     (cons (shen-insert_deref (hd (tl (tl V1181)))) ()))))
  ((and
    (cons? V1181)
    (and
     (= 'when (hd V1181))
     (and (cons? (tl V1181)) (= () (tl (tl V1181))))))
   (cons 'fwhen (cons (shen-insert_deref (hd (tl V1181))) ())))
  ((and
    (cons? V1181)
    (and
     (= 'bind (hd V1181))
     (and
      (cons? (tl V1181))
      (and (cons? (tl (tl V1181))) (= () (tl (tl (tl V1181))))))))
   (cons
    'bind
    (cons
     (hd (tl V1181))
     (cons (shen-insert_lazyderef (hd (tl (tl V1181)))) ()))))
  ((and
    (cons? V1181)
    (and
     (= 'fwhen (hd V1181))
     (and (cons? (tl V1181)) (= () (tl (tl V1181))))))
   (cons 'fwhen (cons (shen-insert_lazyderef (hd (tl V1181))) ())))
  ((cons? V1181)
   (cons (shen-m_prolog_to_s-prolog_predicate (hd V1181)) (tl V1181)))
  (true (shen-sys-error 'shen-s-prolog_literal))))

(defun
 shen-insert_deref
 (V1182)
 (cond
  ((variable? V1182)
   (cons 'shen-deref (cons V1182 (cons 'ProcessN ()))))
  ((cons? V1182)
   (cons
    (shen-insert_deref (hd V1182))
    (shen-insert_deref (tl V1182))))
  (true V1182)))

(defun
 shen-insert_lazyderef
 (V1183)
 (cond
  ((variable? V1183)
   (cons 'shen-lazyderef (cons V1183 (cons 'ProcessN ()))))
  ((cons? V1183)
   (cons
    (shen-insert_lazyderef (hd V1183))
    (shen-insert_lazyderef (tl V1183))))
  (true V1183)))

(defun
 shen-m_prolog_to_s-prolog_predicate
 (V1184)
 (cond
  ((= '= V1184) 'unify)
  ((= '=! V1184) 'unify!)
  ((= '== V1184) 'identical)
  (true V1184)))

(defun
 shen-group_clauses
 (V1185)
 (cond
  ((= () V1185) ())
  ((cons? V1185)
   (let
    Group
    (shen-collect (lambda X (shen-same_predicate? (hd V1185) X)) V1185)
    (let
     Rest
     (difference V1185 Group)
     (cons Group (shen-group_clauses Rest)))))
  (true (shen-sys-error 'shen-group_clauses))))

(defun
 shen-collect
 (V1188 V1189)
 (cond
  ((= () V1189) ())
  ((cons? V1189)
   (if
    ((function V1188) (hd V1189))
    (cons (hd V1189) (shen-collect V1188 (tl V1189)))
    (shen-collect V1188 (tl V1189))))
  (true (shen-sys-error 'shen-collect))))

(defun
 shen-same_predicate?
 (V1206 V1207)
 (cond
  ((and
    (cons? V1206)
    (and (cons? (hd V1206)) (and (cons? V1207) (cons? (hd V1207)))))
   (= (hd (hd V1206)) (hd (hd V1207))))
  (true (shen-sys-error 'shen-same_predicate?))))

(defun
 shen-compile_prolog_procedure
 (V1208)
 (let
  F
  (shen-procedure_name V1208)
  (let Shen (shen-clauses-to-shen F V1208) Shen)))

(defun
 shen-procedure_name
 (V1221)
 (cond
  ((and (cons? V1221) (and (cons? (hd V1221)) (cons? (hd (hd V1221)))))
   (hd (hd (hd V1221))))
  (true (shen-sys-error 'shen-procedure_name))))

(defun
 shen-clauses-to-shen
 (V1222 V1223)
 (let
  Linear
  (map (lambda V1224 (shen-linearise-clause V1224)) V1223)
  (let
   Arity
   (shen-prolog-aritycheck
    V1222
    (map (lambda V1225 (head V1225)) V1223))
   (let
    Parameters
    (shen-parameters Arity)
    (let
     AUM_instructions
     (map (lambda X (shen-aum X Parameters)) Linear)
     (let
      Code
      (shen-catch-cut
       (shen-nest-disjunct
        (map
         (lambda V1226 (shen-aum_to_shen V1226))
         AUM_instructions)))
      (let
       ShenDef
       (cons
        'define
        (cons
         V1222
         (append
          Parameters
          (append
           (cons 'ProcessN (cons 'Continuation ()))
           (cons '-> (cons Code ()))))))
       ShenDef)))))))

(defun
 shen-catch-cut
 (V1227)
 (cond
  ((not (shen-occurs? 'cut V1227)) V1227)
  (true
   (cons
    'let
    (cons
     'Throwcontrol
     (cons
      (cons 'shen-catchpoint ())
      (cons
       (cons 'shen-cutpoint (cons 'Throwcontrol (cons V1227 ())))
       ())))))))

(defun
 shen-catchpoint
 ()
 (set 'shen-*catch* (+ 1 (value 'shen-*catch*))))

(defun
 shen-cutpoint
 (V1232 V1233)
 (cond ((= V1233 V1232) false) (true V1233)))

(defun
 shen-nest-disjunct
 (V1235)
 (cond
  ((and (cons? V1235) (= () (tl V1235))) (hd V1235))
  ((cons? V1235)
   (shen-lisp-or (hd V1235) (shen-nest-disjunct (tl V1235))))
  (true (shen-sys-error 'shen-nest-disjunct))))

(defun
 shen-lisp-or
 (V1236 V1237)
 (cons
  'let
  (cons
   'Case
   (cons
    V1236
    (cons
     (cons
      'if
      (cons
       (cons '= (cons 'Case (cons false ())))
       (cons V1237 (cons 'Case ()))))
     ())))))

(defun
 shen-prolog-aritycheck
 (V1240 V1241)
 (cond
  ((and (cons? V1241) (= () (tl V1241))) (- (length (hd V1241)) 1))
  ((and (cons? V1241) (cons? (tl V1241)))
   (if
    (= (length (hd V1241)) (length (hd (tl V1241))))
    (shen-prolog-aritycheck V1240 (tl V1241))
    (interror
     "arity error in prolog procedure ~A~%"
     (__at__p (cons V1240 ()) ()))))
  (true (shen-sys-error 'shen-prolog-aritycheck))))

(defun
 shen-linearise-clause
 (V1242)
 (cond
  ((and
    (cons? V1242)
    (and
     (cons? (tl V1242))
     (and
      (= (intern ":-") (hd (tl V1242)))
      (and (cons? (tl (tl V1242))) (= () (tl (tl (tl V1242))))))))
   (let
    Linear
    (shen-linearise (cons (hd V1242) (tl (tl V1242))))
    (shen-clause_form Linear)))
  (true (shen-sys-error 'shen-linearise-clause))))

(defun
 shen-clause_form
 (V1243)
 (cond
  ((and (cons? V1243) (and (cons? (tl V1243)) (= () (tl (tl V1243)))))
   (cons
    (shen-explicit_modes (hd V1243))
    (cons (intern ":-") (cons (shen-cf_help (hd (tl V1243))) ()))))
  (true (shen-sys-error 'shen-clause_form))))

(defun
 shen-explicit_modes
 (V1244)
 (cond
  ((cons? V1244)
   (cons
    (hd V1244)
    (map (lambda V1245 (shen-em_help V1245)) (tl V1244))))
  (true (shen-sys-error 'shen-explicit_modes))))

(defun
 shen-em_help
 (V1246)
 (cond
  ((and
    (cons? V1246)
    (and
     (= 'mode (hd V1246))
     (and
      (cons? (tl V1246))
      (and (cons? (tl (tl V1246))) (= () (tl (tl (tl V1246))))))))
   V1246)
  (true (cons 'mode (cons V1246 (cons '+ ()))))))

(defun
 shen-cf_help
 (V1247)
 (cond
  ((and
    (cons? V1247)
    (and
     (= 'where (hd V1247))
     (and
      (cons? (tl V1247))
      (and
       (cons? (hd (tl V1247)))
       (and
        (= '= (hd (hd (tl V1247))))
        (and
         (cons? (tl (hd (tl V1247))))
         (and
          (cons? (tl (tl (hd (tl V1247)))))
          (and
           (= () (tl (tl (tl (hd (tl V1247))))))
           (and
            (cons? (tl (tl V1247)))
            (= () (tl (tl (tl V1247)))))))))))))
   (cons
    (cons
     (if (value 'shen-*occurs*) 'unify! 'unify)
     (tl (hd (tl V1247))))
    (shen-cf_help (hd (tl (tl V1247))))))
  (true V1247)))

(defun
 occurs-check
 (V1252)
 (cond
  ((= '+ V1252) (set 'shen-*occurs* true))
  ((= '- V1252) (set 'shen-*occurs* false))
  (true (interror "occurs-check expects + or -~%" ()))))

(defun
 shen-aum
 (V1253 V1254)
 (cond
  ((and
    (cons? V1253)
    (and
     (cons? (hd V1253))
     (and
      (cons? (tl V1253))
      (and
       (= (intern ":-") (hd (tl V1253)))
       (and (cons? (tl (tl V1253))) (= () (tl (tl (tl V1253)))))))))
   (let
    MuApplication
    (shen-make_mu_application
     (cons
      'shen-mu
      (cons
       (tl (hd V1253))
       (cons
        (shen-continuation_call (tl (hd V1253)) (hd (tl (tl V1253))))
        ())))
     V1254)
    (shen-mu_reduction MuApplication '+)))
  (true (shen-sys-error 'shen-aum))))

(defun
 shen-continuation_call
 (V1255 V1256)
 (let
  VTerms
  (cons 'ProcessN (shen-extract_vars V1255))
  (let
   VBody
   (shen-extract_vars V1256)
   (let
    Free
    (remove 'Throwcontrol (difference VBody VTerms))
    (shen-cc_help Free V1256)))))

(defun
 remove
 (V1259 V1260)
 (cond
  ((= () V1260) ())
  ((and (cons? V1260) (= (hd V1260) V1259))
   (recur (hd V1260) (tl V1260)))
  ((cons? V1260) (cons (hd V1260) (remove V1259 (tl V1260))))
  (true (shen-sys-error 'remove))))

(defun
 shen-cc_help
 (V1262 V1263)
 (cond
  ((and (= () V1262) (= () V1263))
   (cons 'shen-pop (cons 'shen-the (cons 'shen-stack ()))))
  ((= () V1263)
   (cons
    'shen-rename
    (cons
     'shen-the
     (cons
      'shen-variables
      (cons
       'in
       (cons
        V1262
        (cons
         'and
         (cons
          'shen-then
          (cons
           (cons 'shen-pop (cons 'shen-the (cons 'shen-stack ())))
           ())))))))))
  ((= () V1262)
   (cons
    'call
    (cons 'shen-the (cons 'shen-continuation (cons V1263 ())))))
  (true
   (cons
    'shen-rename
    (cons
     'shen-the
     (cons
      'shen-variables
      (cons
       'in
       (cons
        V1262
        (cons
         'and
         (cons
          'shen-then
          (cons
           (cons
            'call
            (cons 'shen-the (cons 'shen-continuation (cons V1263 ()))))
           ())))))))))))

(defun
 shen-make_mu_application
 (V1264 V1265)
 (cond
  ((and
    (cons? V1264)
    (and
     (= 'shen-mu (hd V1264))
     (and
      (cons? (tl V1264))
      (and
       (= () (hd (tl V1264)))
       (and
        (cons? (tl (tl V1264)))
        (and (= () (tl (tl (tl V1264)))) (= () V1265)))))))
   (hd (tl (tl V1264))))
  ((and
    (cons? V1264)
    (and
     (= 'shen-mu (hd V1264))
     (and
      (cons? (tl V1264))
      (and
       (cons? (hd (tl V1264)))
       (and
        (cons? (tl (tl V1264)))
        (and (= () (tl (tl (tl V1264)))) (cons? V1265)))))))
   (cons
    (cons
     'shen-mu
     (cons
      (hd (hd (tl V1264)))
      (cons
       (shen-make_mu_application
        (cons 'shen-mu (cons (tl (hd (tl V1264))) (tl (tl V1264))))
        (tl V1265))
       ())))
    (cons (hd V1265) ())))
  (true (shen-sys-error 'shen-make_mu_application))))

(defun
 shen-mu_reduction
 (V1272 V1273)
 (cond
  ((and
    (cons? V1272)
    (and
     (cons? (hd V1272))
     (and
      (= 'shen-mu (hd (hd V1272)))
      (and
       (cons? (tl (hd V1272)))
       (and
        (cons? (hd (tl (hd V1272))))
        (and
         (= 'mode (hd (hd (tl (hd V1272)))))
         (and
          (cons? (tl (hd (tl (hd V1272)))))
          (and
           (cons? (tl (tl (hd (tl (hd V1272))))))
           (and
            (= () (tl (tl (tl (hd (tl (hd V1272)))))))
            (and
             (cons? (tl (tl (hd V1272))))
             (and
              (= () (tl (tl (tl (hd V1272)))))
              (and
               (cons? (tl V1272))
               (= () (tl (tl V1272)))))))))))))))
   (recur
    (cons
     (cons
      'shen-mu
      (cons (hd (tl (hd (tl (hd V1272))))) (tl (tl (hd V1272)))))
     (tl V1272))
    (hd (tl (tl (hd (tl (hd V1272))))))))
  ((and
    (cons? V1272)
    (and
     (cons? (hd V1272))
     (and
      (= 'shen-mu (hd (hd V1272)))
      (and
       (cons? (tl (hd V1272)))
       (and
        (cons? (tl (tl (hd V1272))))
        (and
         (= () (tl (tl (tl (hd V1272)))))
         (and
          (cons? (tl V1272))
          (and
           (= () (tl (tl V1272)))
           (= '_ (hd (tl (hd V1272))))))))))))
   (recur (hd (tl (tl (hd V1272)))) V1273))
  ((and
    (cons? V1272)
    (and
     (cons? (hd V1272))
     (and
      (= 'shen-mu (hd (hd V1272)))
      (and
       (cons? (tl (hd V1272)))
       (and
        (cons? (tl (tl (hd V1272))))
        (and
         (= () (tl (tl (tl (hd V1272)))))
         (and
          (cons? (tl V1272))
          (and
           (= () (tl (tl V1272)))
           (shen-ephemeral_variable?
            (hd (tl (hd V1272)))
            (hd (tl V1272)))))))))))
   (subst
    (hd (tl V1272))
    (hd (tl (hd V1272)))
    (shen-mu_reduction (hd (tl (tl (hd V1272)))) V1273)))
  ((and
    (cons? V1272)
    (and
     (cons? (hd V1272))
     (and
      (= 'shen-mu (hd (hd V1272)))
      (and
       (cons? (tl (hd V1272)))
       (and
        (cons? (tl (tl (hd V1272))))
        (and
         (= () (tl (tl (tl (hd V1272)))))
         (and
          (cons? (tl V1272))
          (and
           (= () (tl (tl V1272)))
           (variable? (hd (tl (hd V1272))))))))))))
   (cons
    'let
    (cons
     (hd (tl (hd V1272)))
     (cons
      'shen-be
      (cons
       (hd (tl V1272))
       (cons
        'in
        (cons
         (shen-mu_reduction (hd (tl (tl (hd V1272)))) V1273)
         ())))))))
  ((and
    (cons? V1272)
    (and
     (cons? (hd V1272))
     (and
      (= 'shen-mu (hd (hd V1272)))
      (and
       (cons? (tl (hd V1272)))
       (and
        (cons? (tl (tl (hd V1272))))
        (and
         (= () (tl (tl (tl (hd V1272)))))
         (and
          (cons? (tl V1272))
          (and
           (= () (tl (tl V1272)))
           (and
            (= '- V1273)
            (shen-prolog_constant? (hd (tl (hd V1272)))))))))))))
   (let
    Z
    (gensym 'V)
    (cons
     'let
     (cons
      Z
      (cons
       'shen-be
       (cons
        (cons
         'shen-the
         (cons
          'shen-result
          (cons 'shen-of (cons 'shen-dereferencing (tl V1272)))))
        (cons
         'in
         (cons
          (cons
           'if
           (cons
            (cons
             Z
             (cons
              'is
              (cons
               'identical
               (cons 'shen-to (cons (hd (tl (hd V1272))) ())))))
            (cons
             'shen-then
             (cons
              (shen-mu_reduction (hd (tl (tl (hd V1272)))) '-)
              (cons 'shen-else (cons 'fail! ()))))))
          ()))))))))
  ((and
    (cons? V1272)
    (and
     (cons? (hd V1272))
     (and
      (= 'shen-mu (hd (hd V1272)))
      (and
       (cons? (tl (hd V1272)))
       (and
        (cons? (tl (tl (hd V1272))))
        (and
         (= () (tl (tl (tl (hd V1272)))))
         (and
          (cons? (tl V1272))
          (and
           (= () (tl (tl V1272)))
           (and
            (= '+ V1273)
            (shen-prolog_constant? (hd (tl (hd V1272)))))))))))))
   (let
    Z
    (gensym 'V)
    (cons
     'let
     (cons
      Z
      (cons
       'shen-be
       (cons
        (cons
         'shen-the
         (cons
          'shen-result
          (cons 'shen-of (cons 'shen-dereferencing (tl V1272)))))
        (cons
         'in
         (cons
          (cons
           'if
           (cons
            (cons
             Z
             (cons
              'is
              (cons
               'identical
               (cons 'shen-to (cons (hd (tl (hd V1272))) ())))))
            (cons
             'shen-then
             (cons
              (shen-mu_reduction (hd (tl (tl (hd V1272)))) '+)
              (cons
               'shen-else
               (cons
                (cons
                 'if
                 (cons
                  (cons
                   Z
                   (cons 'is (cons 'shen-a (cons 'shen-variable ()))))
                  (cons
                   'shen-then
                   (cons
                    (cons
                     'bind
                     (cons
                      Z
                      (cons
                       'shen-to
                       (cons
                        (hd (tl (hd V1272)))
                        (cons
                         'in
                         (cons
                          (shen-mu_reduction
                           (hd (tl (tl (hd V1272))))
                           '+)
                          ()))))))
                    (cons 'shen-else (cons 'fail! ()))))))
                ()))))))
          ()))))))))
  ((and
    (cons? V1272)
    (and
     (cons? (hd V1272))
     (and
      (= 'shen-mu (hd (hd V1272)))
      (and
       (cons? (tl (hd V1272)))
       (and
        (cons? (hd (tl (hd V1272))))
        (and
         (cons? (tl (tl (hd V1272))))
         (and
          (= () (tl (tl (tl (hd V1272)))))
          (and
           (cons? (tl V1272))
           (and (= () (tl (tl V1272))) (= '- V1273))))))))))
   (let
    Z
    (gensym 'V)
    (cons
     'let
     (cons
      Z
      (cons
       'shen-be
       (cons
        (cons
         'shen-the
         (cons
          'shen-result
          (cons 'shen-of (cons 'shen-dereferencing (tl V1272)))))
        (cons
         'in
         (cons
          (cons
           'if
           (cons
            (cons
             Z
             (cons
              'is
              (cons 'shen-a (cons 'shen-non-empty (cons 'list ())))))
            (cons
             'shen-then
             (cons
              (shen-mu_reduction
               (cons
                (cons
                 'shen-mu
                 (cons
                  (hd (hd (tl (hd V1272))))
                  (cons
                   (cons
                    (cons
                     'shen-mu
                     (cons
                      (tl (hd (tl (hd V1272))))
                      (tl (tl (hd V1272)))))
                    (cons
                     (cons
                      'shen-the
                      (cons 'tail (cons 'shen-of (cons Z ()))))
                     ()))
                   ())))
                (cons
                 (cons
                  'shen-the
                  (cons 'head (cons 'shen-of (cons Z ()))))
                 ()))
               '-)
              (cons 'shen-else (cons 'fail! ()))))))
          ()))))))))
  ((and
    (cons? V1272)
    (and
     (cons? (hd V1272))
     (and
      (= 'shen-mu (hd (hd V1272)))
      (and
       (cons? (tl (hd V1272)))
       (and
        (cons? (hd (tl (hd V1272))))
        (and
         (cons? (tl (tl (hd V1272))))
         (and
          (= () (tl (tl (tl (hd V1272)))))
          (and
           (cons? (tl V1272))
           (and (= () (tl (tl V1272))) (= '+ V1273))))))))))
   (let
    Z
    (gensym 'V)
    (cons
     'let
     (cons
      Z
      (cons
       'shen-be
       (cons
        (cons
         'shen-the
         (cons
          'shen-result
          (cons 'shen-of (cons 'shen-dereferencing (tl V1272)))))
        (cons
         'in
         (cons
          (cons
           'if
           (cons
            (cons
             Z
             (cons
              'is
              (cons 'shen-a (cons 'shen-non-empty (cons 'list ())))))
            (cons
             'shen-then
             (cons
              (shen-mu_reduction
               (cons
                (cons
                 'shen-mu
                 (cons
                  (hd (hd (tl (hd V1272))))
                  (cons
                   (cons
                    (cons
                     'shen-mu
                     (cons
                      (tl (hd (tl (hd V1272))))
                      (tl (tl (hd V1272)))))
                    (cons
                     (cons
                      'shen-the
                      (cons 'tail (cons 'shen-of (cons Z ()))))
                     ()))
                   ())))
                (cons
                 (cons
                  'shen-the
                  (cons 'head (cons 'shen-of (cons Z ()))))
                 ()))
               '+)
              (cons
               'shen-else
               (cons
                (cons
                 'if
                 (cons
                  (cons
                   Z
                   (cons 'is (cons 'shen-a (cons 'shen-variable ()))))
                  (cons
                   'shen-then
                   (cons
                    (cons
                     'shen-rename
                     (cons
                      'shen-the
                      (cons
                       'shen-variables
                       (cons
                        'in
                        (cons
                         (shen-extract_vars (hd (tl (hd V1272))))
                         (cons
                          'and
                          (cons
                           'shen-then
                           (cons
                            (cons
                             'bind
                             (cons
                              Z
                              (cons
                               'shen-to
                               (cons
                                (shen-rcons_form
                                 (shen-remove_modes
                                  (hd (tl (hd V1272)))))
                                (cons
                                 'in
                                 (cons
                                  (shen-mu_reduction
                                   (hd (tl (tl (hd V1272))))
                                   '+)
                                  ()))))))
                            ()))))))))
                    (cons 'shen-else (cons 'fail! ()))))))
                ()))))))
          ()))))))))
  (true V1272)))

(defun
 shen-rcons_form
 (V1274)
 (cond
  ((cons? V1274)
   (cons
    'cons
    (cons
     (shen-rcons_form (hd V1274))
     (cons (shen-rcons_form (tl V1274)) ()))))
  (true V1274)))

(defun
 shen-remove_modes
 (V1275)
 (cond
  ((and
    (cons? V1275)
    (and
     (= 'mode (hd V1275))
     (and
      (cons? (tl V1275))
      (and
       (cons? (tl (tl V1275)))
       (and
        (= '+ (hd (tl (tl V1275))))
        (= () (tl (tl (tl V1275)))))))))
   (recur (hd (tl V1275))))
  ((and
    (cons? V1275)
    (and
     (= 'mode (hd V1275))
     (and
      (cons? (tl V1275))
      (and
       (cons? (tl (tl V1275)))
       (and
        (= '- (hd (tl (tl V1275))))
        (= () (tl (tl (tl V1275)))))))))
   (recur (hd (tl V1275))))
  ((cons? V1275)
   (cons
    (shen-remove_modes (hd V1275))
    (shen-remove_modes (tl V1275))))
  (true V1275)))

(defun
 shen-ephemeral_variable?
 (V1276 V1277)
 (and (variable? V1276) (variable? V1277)))

(defun
 shen-prolog_constant?
 (V1286)
 (cond ((cons? V1286) false) (true true)))

(defun
 shen-aum_to_shen
 (V1287)
 (cond
  ((and
    (cons? V1287)
    (and
     (= 'let (hd V1287))
     (and
      (cons? (tl V1287))
      (and
       (cons? (tl (tl V1287)))
       (and
        (= 'shen-be (hd (tl (tl V1287))))
        (and
         (cons? (tl (tl (tl V1287))))
         (and
          (cons? (tl (tl (tl (tl V1287)))))
          (and
           (= 'in (hd (tl (tl (tl (tl V1287))))))
           (and
            (cons? (tl (tl (tl (tl (tl V1287))))))
            (= () (tl (tl (tl (tl (tl (tl V1287))))))))))))))))
   (cons
    'let
    (cons
     (hd (tl V1287))
     (cons
      (shen-aum_to_shen (hd (tl (tl (tl V1287)))))
      (cons
       (shen-aum_to_shen (hd (tl (tl (tl (tl (tl V1287)))))))
       ())))))
  ((and
    (cons? V1287)
    (and
     (= 'shen-the (hd V1287))
     (and
      (cons? (tl V1287))
      (and
       (= 'shen-result (hd (tl V1287)))
       (and
        (cons? (tl (tl V1287)))
        (and
         (= 'shen-of (hd (tl (tl V1287))))
         (and
          (cons? (tl (tl (tl V1287))))
          (and
           (= 'shen-dereferencing (hd (tl (tl (tl V1287)))))
           (and
            (cons? (tl (tl (tl (tl V1287)))))
            (= () (tl (tl (tl (tl (tl V1287)))))))))))))))
   (cons
    'shen-lazyderef
    (cons
     (shen-aum_to_shen (hd (tl (tl (tl (tl V1287))))))
     (cons 'ProcessN ()))))
  ((and
    (cons? V1287)
    (and
     (= 'if (hd V1287))
     (and
      (cons? (tl V1287))
      (and
       (cons? (tl (tl V1287)))
       (and
        (= 'shen-then (hd (tl (tl V1287))))
        (and
         (cons? (tl (tl (tl V1287))))
         (and
          (cons? (tl (tl (tl (tl V1287)))))
          (and
           (= 'shen-else (hd (tl (tl (tl (tl V1287))))))
           (and
            (cons? (tl (tl (tl (tl (tl V1287))))))
            (= () (tl (tl (tl (tl (tl (tl V1287))))))))))))))))
   (cons
    'if
    (cons
     (shen-aum_to_shen (hd (tl V1287)))
     (cons
      (shen-aum_to_shen (hd (tl (tl (tl V1287)))))
      (cons
       (shen-aum_to_shen (hd (tl (tl (tl (tl (tl V1287)))))))
       ())))))
  ((and
    (cons? V1287)
    (and
     (cons? (tl V1287))
     (and
      (= 'is (hd (tl V1287)))
      (and
       (cons? (tl (tl V1287)))
       (and
        (= 'shen-a (hd (tl (tl V1287))))
        (and
         (cons? (tl (tl (tl V1287))))
         (and
          (= 'shen-variable (hd (tl (tl (tl V1287)))))
          (= () (tl (tl (tl (tl V1287))))))))))))
   (cons 'shen-pvar? (cons (hd V1287) ())))
  ((and
    (cons? V1287)
    (and
     (cons? (tl V1287))
     (and
      (= 'is (hd (tl V1287)))
      (and
       (cons? (tl (tl V1287)))
       (and
        (= 'shen-a (hd (tl (tl V1287))))
        (and
         (cons? (tl (tl (tl V1287))))
         (and
          (= 'shen-non-empty (hd (tl (tl (tl V1287)))))
          (and
           (cons? (tl (tl (tl (tl V1287)))))
           (and
            (= 'list (hd (tl (tl (tl (tl V1287))))))
            (= () (tl (tl (tl (tl (tl V1287)))))))))))))))
   (cons 'cons? (cons (hd V1287) ())))
  ((and
    (cons? V1287)
    (and
     (= 'shen-rename (hd V1287))
     (and
      (cons? (tl V1287))
      (and
       (= 'shen-the (hd (tl V1287)))
       (and
        (cons? (tl (tl V1287)))
        (and
         (= 'shen-variables (hd (tl (tl V1287))))
         (and
          (cons? (tl (tl (tl V1287))))
          (and
           (= 'in (hd (tl (tl (tl V1287)))))
           (and
            (cons? (tl (tl (tl (tl V1287)))))
            (and
             (= () (hd (tl (tl (tl (tl V1287))))))
             (and
              (cons? (tl (tl (tl (tl (tl V1287))))))
              (and
               (= 'and (hd (tl (tl (tl (tl (tl V1287)))))))
               (and
                (cons? (tl (tl (tl (tl (tl (tl V1287)))))))
                (and
                 (=
                  'shen-then
                  (hd (tl (tl (tl (tl (tl (tl V1287))))))))
                 (and
                  (cons? (tl (tl (tl (tl (tl (tl (tl V1287))))))))
                  (=
                   ()
                   (tl
                    (tl
                     (tl
                      (tl (tl (tl (tl (tl V1287))))))))))))))))))))))))
   (recur (hd (tl (tl (tl (tl (tl (tl (tl V1287))))))))))
  ((and
    (cons? V1287)
    (and
     (= 'shen-rename (hd V1287))
     (and
      (cons? (tl V1287))
      (and
       (= 'shen-the (hd (tl V1287)))
       (and
        (cons? (tl (tl V1287)))
        (and
         (= 'shen-variables (hd (tl (tl V1287))))
         (and
          (cons? (tl (tl (tl V1287))))
          (and
           (= 'in (hd (tl (tl (tl V1287)))))
           (and
            (cons? (tl (tl (tl (tl V1287)))))
            (and
             (cons? (hd (tl (tl (tl (tl V1287))))))
             (and
              (cons? (tl (tl (tl (tl (tl V1287))))))
              (and
               (= 'and (hd (tl (tl (tl (tl (tl V1287)))))))
               (and
                (cons? (tl (tl (tl (tl (tl (tl V1287)))))))
                (and
                 (=
                  'shen-then
                  (hd (tl (tl (tl (tl (tl (tl V1287))))))))
                 (and
                  (cons? (tl (tl (tl (tl (tl (tl (tl V1287))))))))
                  (=
                   ()
                   (tl
                    (tl
                     (tl
                      (tl (tl (tl (tl (tl V1287))))))))))))))))))))))))
   (cons
    'let
    (cons
     (hd (hd (tl (tl (tl (tl V1287))))))
     (cons
      (cons 'shen-newpv (cons 'ProcessN ()))
      (cons
       (shen-aum_to_shen
        (cons
         'shen-rename
         (cons
          'shen-the
          (cons
           'shen-variables
           (cons
            'in
            (cons
             (tl (hd (tl (tl (tl (tl V1287))))))
             (tl (tl (tl (tl (tl V1287)))))))))))
       ())))))
  ((and
    (cons? V1287)
    (and
     (= 'bind (hd V1287))
     (and
      (cons? (tl V1287))
      (and
       (cons? (tl (tl V1287)))
       (and
        (= 'shen-to (hd (tl (tl V1287))))
        (and
         (cons? (tl (tl (tl V1287))))
         (and
          (cons? (tl (tl (tl (tl V1287)))))
          (and
           (= 'in (hd (tl (tl (tl (tl V1287))))))
           (and
            (cons? (tl (tl (tl (tl (tl V1287))))))
            (= () (tl (tl (tl (tl (tl (tl V1287))))))))))))))))
   (cons
    'do
    (cons
     (cons
      'shen-bindv
      (cons
       (hd (tl V1287))
       (cons
        (shen-chwild (hd (tl (tl (tl V1287)))))
        (cons 'ProcessN ()))))
     (cons
      (cons
       'let
       (cons
        'Result
        (cons
         (shen-aum_to_shen (hd (tl (tl (tl (tl (tl V1287)))))))
         (cons
          (cons
           'do
           (cons
            (cons
             'shen-unbindv
             (cons (hd (tl V1287)) (cons 'ProcessN ())))
            (cons 'Result ())))
          ()))))
      ()))))
  ((and
    (cons? V1287)
    (and
     (cons? (tl V1287))
     (and
      (= 'is (hd (tl V1287)))
      (and
       (cons? (tl (tl V1287)))
       (and
        (= 'identical (hd (tl (tl V1287))))
        (and
         (cons? (tl (tl (tl V1287))))
         (and
          (= 'shen-to (hd (tl (tl (tl V1287)))))
          (and
           (cons? (tl (tl (tl (tl V1287)))))
           (= () (tl (tl (tl (tl (tl V1287))))))))))))))
   (cons
    '=
    (cons (hd (tl (tl (tl (tl V1287))))) (cons (hd V1287) ()))))
  ((= 'fail! V1287) false)
  ((and
    (cons? V1287)
    (and
     (= 'shen-the (hd V1287))
     (and
      (cons? (tl V1287))
      (and
       (= 'head (hd (tl V1287)))
       (and
        (cons? (tl (tl V1287)))
        (and
         (= 'shen-of (hd (tl (tl V1287))))
         (and
          (cons? (tl (tl (tl V1287))))
          (= () (tl (tl (tl (tl V1287))))))))))))
   (cons 'hd (tl (tl (tl V1287)))))
  ((and
    (cons? V1287)
    (and
     (= 'shen-the (hd V1287))
     (and
      (cons? (tl V1287))
      (and
       (= 'tail (hd (tl V1287)))
       (and
        (cons? (tl (tl V1287)))
        (and
         (= 'shen-of (hd (tl (tl V1287))))
         (and
          (cons? (tl (tl (tl V1287))))
          (= () (tl (tl (tl (tl V1287))))))))))))
   (cons 'tl (tl (tl (tl V1287)))))
  ((and
    (cons? V1287)
    (and
     (= 'shen-pop (hd V1287))
     (and
      (cons? (tl V1287))
      (and
       (= 'shen-the (hd (tl V1287)))
       (and
        (cons? (tl (tl V1287)))
        (and
         (= 'shen-stack (hd (tl (tl V1287))))
         (= () (tl (tl (tl V1287))))))))))
   (cons
    'do
    (cons
     (cons 'shen-incinfs ())
     (cons (cons 'thaw (cons 'Continuation ())) ()))))
  ((and
    (cons? V1287)
    (and
     (= 'call (hd V1287))
     (and
      (cons? (tl V1287))
      (and
       (= 'shen-the (hd (tl V1287)))
       (and
        (cons? (tl (tl V1287)))
        (and
         (= 'shen-continuation (hd (tl (tl V1287))))
         (and
          (cons? (tl (tl (tl V1287))))
          (= () (tl (tl (tl (tl V1287))))))))))))
   (cons
    'do
    (cons
     (cons 'shen-incinfs ())
     (cons
      (shen-call_the_continuation
       (shen-chwild (hd (tl (tl (tl V1287)))))
       'ProcessN
       'Continuation)
      ()))))
  (true V1287)))

(defun
 shen-chwild
 (V1288)
 (cond
  ((= V1288 '_) (cons 'shen-newpv (cons 'ProcessN ())))
  ((cons? V1288) (map (lambda V1289 (shen-chwild V1289)) V1288))
  (true V1288)))

(defun
 shen-newpv
 (V1290)
 (let
  Count+1
  (+ (<-address (value 'shen-*varcounter*) V1290) 1)
  (let
   IncVar
   (address-> (value 'shen-*varcounter*) V1290 Count+1)
   (let
    Vector
    (<-address (value 'shen-*prologvectors*) V1290)
    (let
     ResizeVectorIfNeeded
     (if
      (= Count+1 (limit Vector))
      (shen-resizeprocessvector V1290 Count+1)
      'shen-skip)
     (shen-mk-pvar Count+1))))))

(defun
 shen-resizeprocessvector
 (V1291 V1292)
 (let
  Vector
  (<-address (value 'shen-*prologvectors*) V1291)
  (let
   BigVector
   (shen-resize-vector Vector (+ V1292 V1292) 'shen--null-)
   (address-> (value 'shen-*prologvectors*) V1291 BigVector))))

(defun
 shen-resize-vector
 (V1293 V1294 V1295)
 (let
  BigVector
  (address-> (absvector (+ 1 V1294)) 0 V1294)
  (shen-copy-vector V1293 BigVector (limit V1293) V1294 V1295)))

(defun
 shen-copy-vector
 (V1296 V1297 V1298 V1299 V1300)
 (shen-copy-vector-stage-2
  (+ 1 V1298)
  (+ V1299 1)
  V1300
  (shen-copy-vector-stage-1 1 V1296 V1297 (+ 1 V1298))))

(defun
 shen-copy-vector-stage-1
 (V1303 V1304 V1305 V1306)
 (cond
  ((= V1306 V1303) V1305)
  (true
   (recur
    (+ 1 V1303)
    V1304
    (address-> V1305 V1303 (<-address V1304 V1303))
    V1306))))

(defun
 shen-copy-vector-stage-2
 (V1310 V1311 V1312 V1313)
 (cond
  ((= V1311 V1310) V1313)
  (true
   (recur (+ V1310 1) V1311 V1312 (address-> V1313 V1310 V1312)))))

(defun
 shen-mk-pvar
 (V1315)
 (address-> (address-> (absvector 2) 0 'shen-pvar) 1 V1315))

(defun
 shen-pvar?
 (V1316)
 (and (absvector? V1316) (= (<-address V1316 0) 'shen-pvar)))

(defun
 shen-bindv
 (V1317 V1318 V1319)
 (let
  Vector
  (<-address (value 'shen-*prologvectors*) V1319)
  (address-> Vector (<-address V1317 1) V1318)))

(defun
 shen-unbindv
 (V1320 V1321)
 (let
  Vector
  (<-address (value 'shen-*prologvectors*) V1321)
  (address-> Vector (<-address V1320 1) 'shen--null-)))

(defun shen-incinfs () (set 'shen-*infs* (+ 1 (value 'shen-*infs*))))

(defun
 shen-call_the_continuation
 (V1322 V1323 V1324)
 (cond
  ((and (cons? V1322) (and (cons? (hd V1322)) (= () (tl V1322))))
   (cons
    (hd (hd V1322))
    (append (tl (hd V1322)) (cons V1323 (cons V1324 ())))))
  ((and (cons? V1322) (cons? (hd V1322)))
   (let
    NewContinuation
    (shen-newcontinuation (tl V1322) V1323 V1324)
    (cons
     (hd (hd V1322))
     (append (tl (hd V1322)) (cons V1323 (cons NewContinuation ()))))))
  (true (shen-sys-error 'shen-call_the_continuation))))

(defun
 shen-newcontinuation
 (V1325 V1326 V1327)
 (cond
  ((= () V1325) V1327)
  ((and (cons? V1325) (cons? (hd V1325)))
   (cons
    'freeze
    (cons
     (cons
      (hd (hd V1325))
      (append
       (tl (hd V1325))
       (cons
        V1326
        (cons (shen-newcontinuation (tl V1325) V1326 V1327) ()))))
     ())))
  (true (shen-sys-error 'shen-newcontinuation))))

(defun return (V1332 V1333 V1334) (shen-deref V1332 V1333))

(defun
 shen-measure&return
 (V1339 V1340 V1341)
 (do
  (intoutput "~A inferences~%" (__at__p (value 'shen-*infs*) ()))
  (shen-deref V1339 V1340)))

(defun
 unify
 (V1342 V1343 V1344 V1345)
 (shen-lzy=
  (shen-lazyderef V1342 V1344)
  (shen-lazyderef V1343 V1344)
  V1344
  V1345))

(defun
 shen-lzy=
 (V1362 V1363 V1364 V1365)
 (cond
  ((= V1363 V1362) (thaw V1365))
  ((shen-pvar? V1362) (bind V1362 V1363 V1364 V1365))
  ((shen-pvar? V1363) (bind V1363 V1362 V1364 V1365))
  ((and (cons? V1362) (cons? V1363))
   (recur
    (shen-lazyderef (hd V1362) V1364)
    (shen-lazyderef (hd V1363) V1364)
    V1364
    (freeze
     (shen-lzy=
      (shen-lazyderef (tl V1362) V1364)
      (shen-lazyderef (tl V1363) V1364)
      V1364
      V1365))))
  (true false)))

(defun
 shen-deref
 (V1367 V1368)
 (cond
  ((cons? V1367)
   (cons (shen-deref (hd V1367) V1368) (shen-deref (tl V1367) V1368)))
  (true
   (if
    (shen-pvar? V1367)
    (let
     Value
     (shen-valvector V1367 V1368)
     (if (= Value 'shen--null-) V1367 (shen-deref Value V1368)))
    V1367))))

(defun
 shen-lazyderef
 (V1369 V1370)
 (if
  (shen-pvar? V1369)
  (let
   Value
   (shen-valvector V1369 V1370)
   (if (= Value 'shen--null-) V1369 (recur Value V1370)))
  V1369))

(defun
 shen-valvector
 (V1371 V1372)
 (<-address
  (<-address (value 'shen-*prologvectors*) V1372)
  (<-address V1371 1)))

(defun
 unify!
 (V1373 V1374 V1375 V1376)
 (shen-lzy=!
  (shen-lazyderef V1373 V1375)
  (shen-lazyderef V1374 V1375)
  V1375
  V1376))

(defun
 shen-lzy=!
 (V1393 V1394 V1395 V1396)
 (cond
  ((= V1394 V1393) (thaw V1396))
  ((and
    (shen-pvar? V1393)
    (not (shen-occurs? V1393 (shen-deref V1394 V1395))))
   (bind V1393 V1394 V1395 V1396))
  ((and
    (shen-pvar? V1394)
    (not (shen-occurs? V1394 (shen-deref V1393 V1395))))
   (bind V1394 V1393 V1395 V1396))
  ((and (cons? V1393) (cons? V1394))
   (recur
    (shen-lazyderef (hd V1393) V1395)
    (shen-lazyderef (hd V1394) V1395)
    V1395
    (freeze
     (shen-lzy=!
      (shen-lazyderef (tl V1393) V1395)
      (shen-lazyderef (tl V1394) V1395)
      V1395
      V1396))))
  (true false)))

(defun
 shen-occurs?
 (V1406 V1407)
 (cond
  ((= V1407 V1406) true)
  ((cons? V1407)
   (or
    (shen-occurs? V1406 (hd V1407))
    (shen-occurs? V1406 (tl V1407))))
  (true false)))

(defun
 identical
 (V1409 V1410 V1411 V1412)
 (shen-lzy==
  (shen-lazyderef V1409 V1411)
  (shen-lazyderef V1410 V1411)
  V1411
  V1412))

(defun
 shen-lzy==
 (V1429 V1430 V1431 V1432)
 (cond
  ((= V1430 V1429) (thaw V1432))
  ((and (cons? V1429) (cons? V1430))
   (recur
    (shen-lazyderef (hd V1429) V1431)
    (shen-lazyderef (hd V1430) V1431)
    V1431
    (freeze (shen-lzy== (tl V1429) (tl V1430) V1431 V1432))))
  (true false)))

(defun
 shen-pvar
 (V1434)
 (intmake-string "Var~A" (__at__p (<-address V1434 1) ())))

(defun
 bind
 (V1435 V1436 V1437 V1438)
 (do
  (shen-bindv V1435 V1436 V1437)
  (let Result (thaw V1438) (do (shen-unbindv V1435 V1437) Result))))

(defun
 fwhen
 (V1453 V1454 V1455)
 (cond
  ((= true V1453) (thaw V1455))
  ((= false V1453) false)
  (true
   (interror "fwhen expects a boolean: not ~S%" (__at__p V1453 ())))))

(defun
 call
 (V1468 V1469 V1470)
 (cond
  ((cons? V1468)
   (shen-call-help
    (shen-m_prolog_to_s-prolog_predicate
     (shen-lazyderef (hd V1468) V1469))
    (tl V1468)
    V1469
    V1470))
  (true false)))

(defun
 shen-call-help
 (V1471 V1472 V1473 V1474)
 (cond
  ((= () V1472) ((function V1471) V1473 V1474))
  ((cons? V1472)
   (recur ((function V1471) (hd V1472)) (tl V1472) V1473 V1474))
  (true (shen-sys-error 'shen-call-help))))

(defun
 shen-intprolog
 (V1475)
 (cond
  ((and (cons? V1475) (cons? (hd V1475)))
   (let
    ProcessN
    (shen-start-new-prolog-process)
    (shen-intprolog-help
     (hd (hd V1475))
     (shen-insert-prolog-variables
      (cons (tl (hd V1475)) (cons (tl V1475) ()))
      ProcessN)
     ProcessN)))
  (true (shen-sys-error 'shen-intprolog))))

(defun
 shen-intprolog-help
 (V1476 V1477 V1478)
 (cond
  ((and (cons? V1477) (and (cons? (tl V1477)) (= () (tl (tl V1477)))))
   (shen-intprolog-help-help V1476 (hd V1477) (hd (tl V1477)) V1478))
  (true (shen-sys-error 'shen-intprolog-help))))

(defun
 shen-intprolog-help-help
 (V1479 V1480 V1481 V1482)
 (cond
  ((= () V1480)
   ((function V1479) V1482 (freeze (shen-call-rest V1481 V1482))))
  ((cons? V1480)
   (recur ((function V1479) (hd V1480)) (tl V1480) V1481 V1482))
  (true (shen-sys-error 'shen-intprolog-help-help))))

(defun
 shen-call-rest
 (V1485 V1486)
 (cond
  ((= () V1485) true)
  ((and (cons? V1485) (and (cons? (hd V1485)) (cons? (tl (hd V1485)))))
   (recur
    (cons
     (cons
      ((function (hd (hd V1485))) (hd (tl (hd V1485))))
      (tl (tl (hd V1485))))
     (tl V1485))
    V1486))
  ((and (cons? V1485) (and (cons? (hd V1485)) (= () (tl (hd V1485)))))
   ((function (hd (hd V1485)))
    V1486
    (freeze (shen-call-rest (tl V1485) V1486))))
  (true (shen-sys-error 'shen-call-rest))))

(defun
 shen-start-new-prolog-process
 ()
 (let
  IncrementProcessCounter
  (set 'shen-*process-counter* (+ 1 (value 'shen-*process-counter*)))
  (shen-initialise-prolog IncrementProcessCounter)))

(defun
 shen-insert-prolog-variables
 (V1487 V1488)
 (shen-insert-prolog-variables-help V1487 (shen-flatten V1487) V1488))

(defun
 shen-insert-prolog-variables-help
 (V1493 V1494 V1495)
 (cond
  ((= () V1494) V1493)
  ((and (cons? V1494) (variable? (hd V1494)))
   (let
    V
    (shen-newpv V1495)
    (let
     (intern "XV/Y")
     (subst V (hd V1494) V1493)
     (let
      Z-Y
      (remove (hd V1494) (tl V1494))
      (shen-insert-prolog-variables-help (intern "XV/Y") Z-Y V1495)))))
  ((cons? V1494) (recur V1493 (tl V1494) V1495))
  (true (shen-sys-error 'shen-insert-prolog-variables-help))))

(defun
 shen-initialise-prolog
 (V1496)
 (let
  Vector
  (address->
   (value 'shen-*prologvectors*)
   V1496
   (shen-fillvector (vector 10) 1 11 'shen--null-))
  (let Counter (address-> (value 'shen-*varcounter*) V1496 1) V1496)))

(clojure.core/comment "klambda/reader.kl")

(set 'shen-*symbolcodes* (vector 128))

(address-> (value 'shen-*symbolcodes*) 126 "~")

(address-> (value 'shen-*symbolcodes*) 122 "z")

(address-> (value 'shen-*symbolcodes*) 121 "y")

(address-> (value 'shen-*symbolcodes*) 120 "x")

(address-> (value 'shen-*symbolcodes*) 119 "w")

(address-> (value 'shen-*symbolcodes*) 118 "v")

(address-> (value 'shen-*symbolcodes*) 117 "u")

(address-> (value 'shen-*symbolcodes*) 116 "t")

(address-> (value 'shen-*symbolcodes*) 115 "s")

(address-> (value 'shen-*symbolcodes*) 114 "r")

(address-> (value 'shen-*symbolcodes*) 113 "q")

(address-> (value 'shen-*symbolcodes*) 112 "p")

(address-> (value 'shen-*symbolcodes*) 111 "o")

(address-> (value 'shen-*symbolcodes*) 110 "n")

(address-> (value 'shen-*symbolcodes*) 109 "m")

(address-> (value 'shen-*symbolcodes*) 108 "l")

(address-> (value 'shen-*symbolcodes*) 107 "k")

(address-> (value 'shen-*symbolcodes*) 106 "j")

(address-> (value 'shen-*symbolcodes*) 105 "i")

(address-> (value 'shen-*symbolcodes*) 104 "h")

(address-> (value 'shen-*symbolcodes*) 103 "g")

(address-> (value 'shen-*symbolcodes*) 102 "f")

(address-> (value 'shen-*symbolcodes*) 101 "e")

(address-> (value 'shen-*symbolcodes*) 100 "d")

(address-> (value 'shen-*symbolcodes*) 99 "c")

(address-> (value 'shen-*symbolcodes*) 98 "b")

(address-> (value 'shen-*symbolcodes*) 97 "a")

(address->
 (value 'shen-*symbolcodes*)
 96
 (if (= (value '*language*) "Common Lisp") "_backquote" "`"))

(address-> (value 'shen-*symbolcodes*) 95 "_")

(address-> (value 'shen-*symbolcodes*) 90 "Z")

(address-> (value 'shen-*symbolcodes*) 89 "Y")

(address-> (value 'shen-*symbolcodes*) 88 "X")

(address-> (value 'shen-*symbolcodes*) 87 "W")

(address-> (value 'shen-*symbolcodes*) 86 "V")

(address-> (value 'shen-*symbolcodes*) 85 "U")

(address-> (value 'shen-*symbolcodes*) 84 "T")

(address-> (value 'shen-*symbolcodes*) 83 "S")

(address-> (value 'shen-*symbolcodes*) 82 "R")

(address-> (value 'shen-*symbolcodes*) 81 "Q")

(address-> (value 'shen-*symbolcodes*) 80 "P")

(address-> (value 'shen-*symbolcodes*) 79 "O")

(address-> (value 'shen-*symbolcodes*) 78 "N")

(address-> (value 'shen-*symbolcodes*) 77 "M")

(address-> (value 'shen-*symbolcodes*) 76 "L")

(address-> (value 'shen-*symbolcodes*) 75 "K")

(address-> (value 'shen-*symbolcodes*) 74 "J")

(address-> (value 'shen-*symbolcodes*) 73 "I")

(address-> (value 'shen-*symbolcodes*) 72 "H")

(address-> (value 'shen-*symbolcodes*) 71 "G")

(address-> (value 'shen-*symbolcodes*) 70 "F")

(address-> (value 'shen-*symbolcodes*) 69 "E")

(address-> (value 'shen-*symbolcodes*) 68 "D")

(address-> (value 'shen-*symbolcodes*) 67 "C")

(address-> (value 'shen-*symbolcodes*) 66 "B")

(address-> (value 'shen-*symbolcodes*) 65 "A")

(address-> (value 'shen-*symbolcodes*) 64 "__at__")

(address-> (value 'shen-*symbolcodes*) 63 "?")

(address-> (value 'shen-*symbolcodes*) 62 ">")

(address-> (value 'shen-*symbolcodes*) 61 "=")

(address-> (value 'shen-*symbolcodes*) 60 "<")

(address-> (value 'shen-*symbolcodes*) 57 "9")

(address-> (value 'shen-*symbolcodes*) 56 "8")

(address-> (value 'shen-*symbolcodes*) 55 "7")

(address-> (value 'shen-*symbolcodes*) 54 "6")

(address-> (value 'shen-*symbolcodes*) 53 "5")

(address-> (value 'shen-*symbolcodes*) 52 "4")

(address-> (value 'shen-*symbolcodes*) 51 "3")

(address-> (value 'shen-*symbolcodes*) 50 "2")

(address-> (value 'shen-*symbolcodes*) 49 "1")

(address-> (value 'shen-*symbolcodes*) 48 "0")

(address-> (value 'shen-*symbolcodes*) 47 "/")

(address-> (value 'shen-*symbolcodes*) 46 ".")

(address-> (value 'shen-*symbolcodes*) 45 "-")

(address-> (value 'shen-*symbolcodes*) 43 "+")

(address-> (value 'shen-*symbolcodes*) 42 "*")

(address->
 (value 'shen-*symbolcodes*)
 39
 (if (= (value '*language*) "Common Lisp") "_quote" "'"))

(address-> (value 'shen-*symbolcodes*) 38 "&")

(address-> (value 'shen-*symbolcodes*) 37 "%")

(address-> (value 'shen-*symbolcodes*) 36 "$")

(address->
 (value 'shen-*symbolcodes*)
 35
 (if (= (value '*language*) "Common Lisp") "_hash" "#"))

(address-> (value 'shen-*symbolcodes*) 33 "!")

(defun lineread () (shen-lineread-kl_loop (read-byte (stinput 0)) ()))

(defun
 shen-lineread-kl_loop
 (V926 V927)
 (cond
  ((= V926 (shen-hat)) (interror "line read aborted" ()))
  ((element?
    V926
    (cons (shen-newline) (cons (shen-carriage-return) ())))
   (let
    Line
    (compile (lambda V928 (shen-<st_input> V928)) V927 ())
    (if
     (or (= Line (fail)) (empty? Line))
     (shen-lineread-kl_loop
      (read-byte (stinput 0))
      (append V927 (cons V926 ())))
     Line)))
  (true (recur (read-byte (stinput 0)) (append V927 (cons V926 ()))))))

(defun
 read-file
 (V929)
 (let
  Bytelist
  (read-file-as-bytelist V929)
  (compile
   (lambda V930 (shen-<st_input> V930))
   Bytelist
   (lambda V931 (shen-read-error V931)))))

(defun
 shen-read-error
 (V932)
 (interror
  "read error here:~%~% ~A~%"
  (__at__p (shen-compress-50 50 V932) ())))

(defun
 shen-compress-50
 (V937 V938)
 (cond
  ((= () V938) "")
  ((= 0 V937) "")
  ((cons? V938)
   (cn (n->string (hd V938)) (shen-compress-50 (- V937 1) (tl V938))))
  (true (shen-sys-error 'shen-compress-50))))

(defun
 shen-<st_input>
 (V939)
 (let
  Result
  (let
   Parse_<lsb>
   (shen-<lsb> V939)
   (if
    (not (= (fail) Parse_<lsb>))
    (let
     Parse_<st_input1>
     (shen-<st_input1> Parse_<lsb>)
     (if
      (not (= (fail) Parse_<st_input1>))
      (let
       Parse_<rsb>
       (shen-<rsb> Parse_<st_input1>)
       (if
        (not (= (fail) Parse_<rsb>))
        (let
         Parse_<st_input2>
         (shen-<st_input2> Parse_<rsb>)
         (if
          (not (= (fail) Parse_<st_input2>))
          (shen-reassemble
           (fst Parse_<st_input2>)
           (cons
            (macroexpand (shen-cons_form (snd Parse_<st_input1>)))
            (snd Parse_<st_input2>)))
          (fail)))
        (fail)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<lrb>
     (shen-<lrb> V939)
     (if
      (not (= (fail) Parse_<lrb>))
      (let
       Parse_<st_input1>
       (shen-<st_input1> Parse_<lrb>)
       (if
        (not (= (fail) Parse_<st_input1>))
        (let
         Parse_<rrb>
         (shen-<rrb> Parse_<st_input1>)
         (if
          (not (= (fail) Parse_<rrb>))
          (let
           Parse_<st_input2>
           (shen-<st_input2> Parse_<rrb>)
           (if
            (not (= (fail) Parse_<st_input2>))
            (shen-reassemble
             (fst Parse_<st_input2>)
             (shen-package-macro
              (macroexpand (snd Parse_<st_input1>))
              (snd Parse_<st_input2>)))
            (fail)))
          (fail)))
        (fail)))
      (fail)))
    (if
     (= Result (fail))
     (let
      Result
      (let
       Parse_<lcurly>
       (shen-<lcurly> V939)
       (if
        (not (= (fail) Parse_<lcurly>))
        (let
         Parse_<st_input>
         (shen-<st_input> Parse_<lcurly>)
         (if
          (not (= (fail) Parse_<st_input>))
          (shen-reassemble
           (fst Parse_<st_input>)
           (cons (intern "{") (snd Parse_<st_input>)))
          (fail)))
        (fail)))
      (if
       (= Result (fail))
       (let
        Result
        (let
         Parse_<rcurly>
         (shen-<rcurly> V939)
         (if
          (not (= (fail) Parse_<rcurly>))
          (let
           Parse_<st_input>
           (shen-<st_input> Parse_<rcurly>)
           (if
            (not (= (fail) Parse_<st_input>))
            (shen-reassemble
             (fst Parse_<st_input>)
             (cons (intern "}") (snd Parse_<st_input>)))
            (fail)))
          (fail)))
        (if
         (= Result (fail))
         (let
          Result
          (let
           Parse_<bar>
           (shen-<bar> V939)
           (if
            (not (= (fail) Parse_<bar>))
            (let
             Parse_<st_input>
             (shen-<st_input> Parse_<bar>)
             (if
              (not (= (fail) Parse_<st_input>))
              (shen-reassemble
               (fst Parse_<st_input>)
               (cons 'bar! (snd Parse_<st_input>)))
              (fail)))
            (fail)))
          (if
           (= Result (fail))
           (let
            Result
            (let
             Parse_<semicolon>
             (shen-<semicolon> V939)
             (if
              (not (= (fail) Parse_<semicolon>))
              (let
               Parse_<st_input>
               (shen-<st_input> Parse_<semicolon>)
               (if
                (not (= (fail) Parse_<st_input>))
                (shen-reassemble
                 (fst Parse_<st_input>)
                 (cons (intern ";") (snd Parse_<st_input>)))
                (fail)))
              (fail)))
            (if
             (= Result (fail))
             (let
              Result
              (let
               Parse_<colon>
               (shen-<colon> V939)
               (if
                (not (= (fail) Parse_<colon>))
                (let
                 Parse_<equal>
                 (shen-<equal> Parse_<colon>)
                 (if
                  (not (= (fail) Parse_<equal>))
                  (let
                   Parse_<st_input>
                   (shen-<st_input> Parse_<equal>)
                   (if
                    (not (= (fail) Parse_<st_input>))
                    (shen-reassemble
                     (fst Parse_<st_input>)
                     (cons (intern ":=") (snd Parse_<st_input>)))
                    (fail)))
                  (fail)))
                (fail)))
              (if
               (= Result (fail))
               (let
                Result
                (let
                 Parse_<colon>
                 (shen-<colon> V939)
                 (if
                  (not (= (fail) Parse_<colon>))
                  (let
                   Parse_<minus>
                   (shen-<minus> Parse_<colon>)
                   (if
                    (not (= (fail) Parse_<minus>))
                    (let
                     Parse_<st_input>
                     (shen-<st_input> Parse_<minus>)
                     (if
                      (not (= (fail) Parse_<st_input>))
                      (shen-reassemble
                       (fst Parse_<st_input>)
                       (cons (intern ":-") (snd Parse_<st_input>)))
                      (fail)))
                    (fail)))
                  (fail)))
                (if
                 (= Result (fail))
                 (let
                  Result
                  (let
                   Parse_<colon>
                   (shen-<colon> V939)
                   (if
                    (not (= (fail) Parse_<colon>))
                    (let
                     Parse_<st_input>
                     (shen-<st_input> Parse_<colon>)
                     (if
                      (not (= (fail) Parse_<st_input>))
                      (shen-reassemble
                       (fst Parse_<st_input>)
                       (cons (intern ":") (snd Parse_<st_input>)))
                      (fail)))
                    (fail)))
                  (if
                   (= Result (fail))
                   (let
                    Result
                    (let
                     Parse_<comma>
                     (shen-<comma> V939)
                     (if
                      (not (= (fail) Parse_<comma>))
                      (let
                       Parse_<st_input>
                       (shen-<st_input> Parse_<comma>)
                       (if
                        (not (= (fail) Parse_<st_input>))
                        (shen-reassemble
                         (fst Parse_<st_input>)
                         (cons 'shen- (snd Parse_<st_input>)))
                        (fail)))
                      (fail)))
                    (if
                     (= Result (fail))
                     (let
                      Result
                      (let
                       Parse_<comment>
                       (shen-<comment> V939)
                       (if
                        (not (= (fail) Parse_<comment>))
                        (let
                         Parse_<st_input>
                         (shen-<st_input> Parse_<comment>)
                         (if
                          (not (= (fail) Parse_<st_input>))
                          (shen-reassemble
                           (fst Parse_<st_input>)
                           (snd Parse_<st_input>))
                          (fail)))
                        (fail)))
                      (if
                       (= Result (fail))
                       (let
                        Result
                        (let
                         Parse_<atom>
                         (shen-<atom> V939)
                         (if
                          (not (= (fail) Parse_<atom>))
                          (let
                           Parse_<st_input>
                           (shen-<st_input> Parse_<atom>)
                           (if
                            (not (= (fail) Parse_<st_input>))
                            (shen-reassemble
                             (fst Parse_<st_input>)
                             (cons
                              (macroexpand (snd Parse_<atom>))
                              (snd Parse_<st_input>)))
                            (fail)))
                          (fail)))
                        (if
                         (= Result (fail))
                         (let
                          Result
                          (let
                           Parse_<whitespaces>
                           (shen-<whitespaces> V939)
                           (if
                            (not (= (fail) Parse_<whitespaces>))
                            (let
                             Parse_<st_input>
                             (shen-<st_input> Parse_<whitespaces>)
                             (if
                              (not (= (fail) Parse_<st_input>))
                              (shen-reassemble
                               (fst Parse_<st_input>)
                               (snd Parse_<st_input>))
                              (fail)))
                            (fail)))
                          (if
                           (= Result (fail))
                           (let
                            Result
                            (let
                             Parse_<e>
                             (<e> V939)
                             (if
                              (not (= (fail) Parse_<e>))
                              (shen-reassemble (fst Parse_<e>) ())
                              (fail)))
                            (if (= Result (fail)) (fail) Result))
                           Result))
                         Result))
                       Result))
                     Result))
                   Result))
                 Result))
               Result))
             Result))
           Result))
         Result))
       Result))
     Result))
   Result)))

(defun
 shen-<lsb>
 (V940)
 (let
  Result
  (if
   (cons? (fst V940))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V940)) (snd V940)))
    (if (= (hd (fst V940)) 91) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<rsb>
 (V941)
 (let
  Result
  (if
   (cons? (fst V941))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V941)) (snd V941)))
    (if (= (hd (fst V941)) 93) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<lcurly>
 (V942)
 (let
  Result
  (if
   (cons? (fst V942))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V942)) (snd V942)))
    (if (= (hd (fst V942)) 123) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<rcurly>
 (V943)
 (let
  Result
  (if
   (cons? (fst V943))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V943)) (snd V943)))
    (if (= (hd (fst V943)) 125) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<bar>
 (V944)
 (let
  Result
  (if
   (cons? (fst V944))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V944)) (snd V944)))
    (if (= (hd (fst V944)) 124) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<semicolon>
 (V945)
 (let
  Result
  (if
   (cons? (fst V945))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V945)) (snd V945)))
    (if (= (hd (fst V945)) 59) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<colon>
 (V946)
 (let
  Result
  (if
   (cons? (fst V946))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V946)) (snd V946)))
    (if (= (hd (fst V946)) 58) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<comma>
 (V947)
 (let
  Result
  (if
   (cons? (fst V947))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V947)) (snd V947)))
    (if (= (hd (fst V947)) 44) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<equal>
 (V948)
 (let
  Result
  (if
   (cons? (fst V948))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V948)) (snd V948)))
    (if (= (hd (fst V948)) 61) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<minus>
 (V949)
 (let
  Result
  (if
   (cons? (fst V949))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V949)) (snd V949)))
    (if (= (hd (fst V949)) 45) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<lrb>
 (V950)
 (let
  Result
  (if
   (cons? (fst V950))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V950)) (snd V950)))
    (if (= (hd (fst V950)) 40) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<rrb>
 (V951)
 (let
  Result
  (if
   (cons? (fst V951))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V951)) (snd V951)))
    (if (= (hd (fst V951)) 41) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<atom>
 (V952)
 (let
  Result
  (let
   Parse_<str>
   (shen-<str> V952)
   (if
    (not (= (fail) Parse_<str>))
    (shen-reassemble
     (fst Parse_<str>)
     (shen-control-chars (snd Parse_<str>)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<number>
     (shen-<number> V952)
     (if
      (not (= (fail) Parse_<number>))
      (shen-reassemble (fst Parse_<number>) (snd Parse_<number>))
      (fail)))
    (if
     (= Result (fail))
     (let
      Result
      (let
       Parse_<sym>
       (shen-<sym> V952)
       (if
        (not (= (fail) Parse_<sym>))
        (shen-reassemble (fst Parse_<sym>) (snd Parse_<sym>))
        (fail)))
      (if (= Result (fail)) (fail) Result))
     Result))
   Result)))

(defun
 shen-control-chars
 (V953)
 (cond
  ((= () V953) "")
  ((and
    (cons? V953)
    (and
     (= "c" (hd V953))
     (and (cons? (tl V953)) (= "#" (hd (tl V953))))))
   (let
    CodePoint
    (shen-code-point (tl (tl V953)))
    (let
     AfterCodePoint
     (shen-after-codepoint (tl (tl V953)))
     (__at__s
      (n->string (shen-decimalise CodePoint))
      (shen-control-chars AfterCodePoint)))))
  ((cons? V953) (__at__s (hd V953) (shen-control-chars (tl V953))))
  (true (shen-sys-error 'shen-control-chars))))

(defun
 shen-code-point
 (V956)
 (cond
  ((and (cons? V956) (= ";" (hd V956))) "")
  ((and
    (cons? V956)
    (element?
     (hd V956)
     (cons
      "0"
      (cons
       "1"
       (cons
        "2"
        (cons
         "3"
         (cons
          "4"
          (cons
           "5"
           (cons
            "6"
            (cons "7" (cons "8" (cons "9" (cons "0" ())))))))))))))
   (cons (hd V956) (shen-code-point (tl V956))))
  (true (interror "code point parse error ~A~%" (__at__p V956 ())))))

(defun
 shen-after-codepoint
 (V961)
 (cond
  ((= () V961) ())
  ((and (cons? V961) (= ";" (hd V961))) (tl V961))
  ((cons? V961) (recur (tl V961)))
  (true (shen-sys-error 'shen-after-codepoint))))

(defun
 shen-decimalise
 (V962)
 (shen-pre (reverse (shen-digits->integers V962)) 0))

(defun
 shen-digits->integers
 (V967)
 (cond
  ((and (cons? V967) (= "0" (hd V967)))
   (cons 0 (shen-digits->integers (tl V967))))
  ((and (cons? V967) (= "1" (hd V967)))
   (cons 1 (shen-digits->integers (tl V967))))
  ((and (cons? V967) (= "2" (hd V967)))
   (cons 2 (shen-digits->integers (tl V967))))
  ((and (cons? V967) (= "3" (hd V967)))
   (cons 3 (shen-digits->integers (tl V967))))
  ((and (cons? V967) (= "4" (hd V967)))
   (cons 4 (shen-digits->integers (tl V967))))
  ((and (cons? V967) (= "5" (hd V967)))
   (cons 5 (shen-digits->integers (tl V967))))
  ((and (cons? V967) (= "6" (hd V967)))
   (cons 6 (shen-digits->integers (tl V967))))
  ((and (cons? V967) (= "7" (hd V967)))
   (cons 7 (shen-digits->integers (tl V967))))
  ((and (cons? V967) (= "8" (hd V967)))
   (cons 8 (shen-digits->integers (tl V967))))
  ((and (cons? V967) (= "9" (hd V967)))
   (cons 9 (shen-digits->integers (tl V967))))
  (true ())))

(defun
 shen-<sym>
 (V968)
 (let
  Result
  (let
   Parse_<alpha>
   (shen-<alpha> V968)
   (if
    (not (= (fail) Parse_<alpha>))
    (let
     Parse_<symchars>
     (shen-<symchars> Parse_<alpha>)
     (if
      (not (= (fail) Parse_<symchars>))
      (shen-reassemble
       (fst Parse_<symchars>)
       (intern (cn (snd Parse_<alpha>) (snd Parse_<symchars>))))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<alpha>
     (shen-<alpha> V968)
     (if
      (not (= (fail) Parse_<alpha>))
      (shen-reassemble
       (fst Parse_<alpha>)
       (intern (snd Parse_<alpha>)))
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<symchars>
 (V969)
 (let
  Result
  (let
   Parse_<symchar>
   (shen-<symchar> V969)
   (if
    (not (= (fail) Parse_<symchar>))
    (let
     Parse_<symchars>
     (shen-<symchars> Parse_<symchar>)
     (if
      (not (= (fail) Parse_<symchars>))
      (shen-reassemble
       (fst Parse_<symchars>)
       (cn (snd Parse_<symchar>) (snd Parse_<symchars>)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<symchar>
     (shen-<symchar> V969)
     (if
      (not (= (fail) Parse_<symchar>))
      (shen-reassemble (fst Parse_<symchar>) (snd Parse_<symchar>))
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<symchar>
 (V970)
 (let
  Result
  (let
   Parse_<alpha>
   (shen-<alpha> V970)
   (if
    (not (= (fail) Parse_<alpha>))
    (shen-reassemble (fst Parse_<alpha>) (snd Parse_<alpha>))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<digit->string>
     (shen-<digit->string> V970)
     (if
      (not (= (fail) Parse_<digit->string>))
      (shen-reassemble
       (fst Parse_<digit->string>)
       (snd Parse_<digit->string>))
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<digit->string>
 (V971)
 (let
  Result
  (if
   (cons? (fst V971))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V971)) (snd V971)))
    (if
     (shen-digit-byte? (hd (fst V971)))
     (n->string (hd (fst V971)))
     (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-digit-byte?
 (V976)
 (cond
  ((= 48 V976) true)
  ((= 49 V976) true)
  ((= 50 V976) true)
  ((= 51 V976) true)
  ((= 52 V976) true)
  ((= 53 V976) true)
  ((= 54 V976) true)
  ((= 55 V976) true)
  ((= 56 V976) true)
  ((= 57 V976) true)
  (true false)))

(defun
 shen-<alpha>
 (V977)
 (let
  Result
  (if
   (cons? (fst V977))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V977)) (snd V977)))
    (let
     S
     (shen-symbol-byte->string (hd (fst V977)))
     (if (= S (fail)) (fail) S)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-symbol-byte->string
 (V978)
 (<-address (value 'shen-*symbolcodes*) V978))

(defun
 shen-<str>
 (V979)
 (let
  Result
  (let
   Parse_<dbq>
   (shen-<dbq> V979)
   (if
    (not (= (fail) Parse_<dbq>))
    (let
     Parse_<strcontents>
     (shen-<strcontents> Parse_<dbq>)
     (if
      (not (= (fail) Parse_<strcontents>))
      (let
       Parse_<dbq>
       (shen-<dbq> Parse_<strcontents>)
       (if
        (not (= (fail) Parse_<dbq>))
        (shen-reassemble (fst Parse_<dbq>) (snd Parse_<strcontents>))
        (fail)))
      (fail)))
    (fail)))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<dbq>
 (V980)
 (let
  Result
  (if
   (cons? (fst V980))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V980)) (snd V980)))
    (if (= (hd (fst V980)) 34) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<strcontents>
 (V981)
 (let
  Result
  (let
   Parse_<backslash>
   (shen-<backslash> V981)
   (if
    (not (= (fail) Parse_<backslash>))
    (let
     Parse_<byte>
     (shen-<byte> Parse_<backslash>)
     (if
      (not (= (fail) Parse_<byte>))
      (let
       Parse_<strcontents>
       (shen-<strcontents> Parse_<byte>)
       (if
        (not (= (fail) Parse_<strcontents>))
        (shen-reassemble
         (fst Parse_<strcontents>)
         (cons (snd Parse_<byte>) (snd Parse_<strcontents>)))
        (fail)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<strc>
     (shen-<strc> V981)
     (if
      (not (= (fail) Parse_<strc>))
      (let
       Parse_<strcontents>
       (shen-<strcontents> Parse_<strc>)
       (if
        (not (= (fail) Parse_<strcontents>))
        (shen-reassemble
         (fst Parse_<strcontents>)
         (cons (snd Parse_<strc>) (snd Parse_<strcontents>)))
        (fail)))
      (fail)))
    (if
     (= Result (fail))
     (let
      Result
      (let
       Parse_<e>
       (<e> V981)
       (if
        (not (= (fail) Parse_<e>))
        (shen-reassemble (fst Parse_<e>) ())
        (fail)))
      (if (= Result (fail)) (fail) Result))
     Result))
   Result)))

(defun
 shen-<byte>
 (V982)
 (let
  Result
  (if
   (cons? (fst V982))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V982)) (snd V982)))
    (n->string (hd (fst V982))))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<strc>
 (V983)
 (let
  Result
  (if
   (cons? (fst V983))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V983)) (snd V983)))
    (if (= (hd (fst V983)) 34) (fail) (n->string (hd (fst V983)))))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<backslash>
 (V984)
 (let
  Result
  (if
   (cons? (fst V984))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V984)) (snd V984)))
    (if (= (hd (fst V984)) 92) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<number>
 (V985)
 (let
  Result
  (let
   Parse_<minus>
   (shen-<minus> V985)
   (if
    (not (= (fail) Parse_<minus>))
    (let
     Parse_<number>
     (shen-<number> Parse_<minus>)
     (if
      (not (= (fail) Parse_<number>))
      (shen-reassemble (fst Parse_<number>) (- 0 (snd Parse_<number>)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<plus>
     (shen-<plus> V985)
     (if
      (not (= (fail) Parse_<plus>))
      (let
       Parse_<number>
       (shen-<number> Parse_<plus>)
       (if
        (not (= (fail) Parse_<number>))
        (shen-reassemble (fst Parse_<number>) (snd Parse_<number>))
        (fail)))
      (fail)))
    (if
     (= Result (fail))
     (let
      Result
      (let
       Parse_<predigits>
       (shen-<predigits> V985)
       (if
        (not (= (fail) Parse_<predigits>))
        (let
         Parse_<stop>
         (shen-<stop> Parse_<predigits>)
         (if
          (not (= (fail) Parse_<stop>))
          (let
           Parse_<postdigits>
           (shen-<postdigits> Parse_<stop>)
           (if
            (not (= (fail) Parse_<postdigits>))
            (let
             Parse_<E>
             (shen-<E> Parse_<postdigits>)
             (if
              (not (= (fail) Parse_<E>))
              (let
               Parse_<log10>
               (shen-<log10> Parse_<E>)
               (if
                (not (= (fail) Parse_<log10>))
                (shen-reassemble
                 (fst Parse_<log10>)
                 (*
                  (shen-expt 10 (snd Parse_<log10>))
                  (+
                   (shen-pre (reverse (snd Parse_<predigits>)) 0)
                   (shen-post (snd Parse_<postdigits>) 1))))
                (fail)))
              (fail)))
            (fail)))
          (fail)))
        (fail)))
      (if
       (= Result (fail))
       (let
        Result
        (let
         Parse_<digits>
         (shen-<digits> V985)
         (if
          (not (= (fail) Parse_<digits>))
          (let
           Parse_<E>
           (shen-<E> Parse_<digits>)
           (if
            (not (= (fail) Parse_<E>))
            (let
             Parse_<log10>
             (shen-<log10> Parse_<E>)
             (if
              (not (= (fail) Parse_<log10>))
              (shen-reassemble
               (fst Parse_<log10>)
               (*
                (shen-expt 10 (snd Parse_<log10>))
                (shen-pre (reverse (snd Parse_<digits>)) 0)))
              (fail)))
            (fail)))
          (fail)))
        (if
         (= Result (fail))
         (let
          Result
          (let
           Parse_<predigits>
           (shen-<predigits> V985)
           (if
            (not (= (fail) Parse_<predigits>))
            (let
             Parse_<stop>
             (shen-<stop> Parse_<predigits>)
             (if
              (not (= (fail) Parse_<stop>))
              (let
               Parse_<postdigits>
               (shen-<postdigits> Parse_<stop>)
               (if
                (not (= (fail) Parse_<postdigits>))
                (shen-reassemble
                 (fst Parse_<postdigits>)
                 (+
                  (shen-pre (reverse (snd Parse_<predigits>)) 0)
                  (shen-post (snd Parse_<postdigits>) 1)))
                (fail)))
              (fail)))
            (fail)))
          (if
           (= Result (fail))
           (let
            Result
            (let
             Parse_<digits>
             (shen-<digits> V985)
             (if
              (not (= (fail) Parse_<digits>))
              (shen-reassemble
               (fst Parse_<digits>)
               (shen-pre (reverse (snd Parse_<digits>)) 0))
              (fail)))
            (if (= Result (fail)) (fail) Result))
           Result))
         Result))
       Result))
     Result))
   Result)))

(defun
 shen-<E>
 (V986)
 (let
  Result
  (if
   (and (cons? (fst V986)) (= 101 (hd (fst V986))))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V986)) (snd V986)))
    (cons 101 ()))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<log10>
 (V987)
 (let
  Result
  (let
   Parse_<minus>
   (shen-<minus> V987)
   (if
    (not (= (fail) Parse_<minus>))
    (let
     Parse_<digits>
     (shen-<digits> Parse_<minus>)
     (if
      (not (= (fail) Parse_<digits>))
      (shen-reassemble
       (fst Parse_<digits>)
       (- 0 (shen-pre (reverse (snd Parse_<digits>)) 0)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<digits>
     (shen-<digits> V987)
     (if
      (not (= (fail) Parse_<digits>))
      (shen-reassemble
       (fst Parse_<digits>)
       (shen-pre (reverse (snd Parse_<digits>)) 0))
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<plus>
 (V988)
 (let
  Result
  (if
   (cons? (fst V988))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V988)) (snd V988)))
    (if (= (hd (fst V988)) 43) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<stop>
 (V989)
 (let
  Result
  (if
   (cons? (fst V989))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V989)) (snd V989)))
    (if (= (hd (fst V989)) 46) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<predigits>
 (V990)
 (let
  Result
  (let
   Parse_<digits>
   (shen-<digits> V990)
   (if
    (not (= (fail) Parse_<digits>))
    (shen-reassemble (fst Parse_<digits>) (snd Parse_<digits>))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<e>
     (<e> V990)
     (if
      (not (= (fail) Parse_<e>))
      (shen-reassemble (fst Parse_<e>) ())
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<postdigits>
 (V991)
 (let
  Result
  (let
   Parse_<digits>
   (shen-<digits> V991)
   (if
    (not (= (fail) Parse_<digits>))
    (shen-reassemble (fst Parse_<digits>) (snd Parse_<digits>))
    (fail)))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<digits>
 (V992)
 (let
  Result
  (let
   Parse_<digit>
   (shen-<digit> V992)
   (if
    (not (= (fail) Parse_<digit>))
    (let
     Parse_<digits>
     (shen-<digits> Parse_<digit>)
     (if
      (not (= (fail) Parse_<digits>))
      (shen-reassemble
       (fst Parse_<digits>)
       (cons (snd Parse_<digit>) (snd Parse_<digits>)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<digit>
     (shen-<digit> V992)
     (if
      (not (= (fail) Parse_<digit>))
      (shen-reassemble
       (fst Parse_<digit>)
       (cons (snd Parse_<digit>) ()))
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<digit>
 (V993)
 (let
  Result
  (if
   (cons? (fst V993))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V993)) (snd V993)))
    (if
     (shen-digit-byte? (hd (fst V993)))
     (shen-byte->digit (hd (fst V993)))
     (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-byte->digit
 (V994)
 (cond
  ((= 48 V994) 0)
  ((= 49 V994) 1)
  ((= 50 V994) 2)
  ((= 51 V994) 3)
  ((= 52 V994) 4)
  ((= 53 V994) 5)
  ((= 54 V994) 6)
  ((= 55 V994) 7)
  ((= 56 V994) 8)
  ((= 57 V994) 9)
  (true (shen-sys-error 'shen-byte->digit))))

(defun
 shen-pre
 (V997 V998)
 (cond
  ((= () V997) 0)
  ((cons? V997)
   (+
    (* (shen-expt 10 V998) (hd V997))
    (shen-pre (tl V997) (+ V998 1))))
  (true (shen-sys-error 'shen-pre))))

(defun
 shen-post
 (V1001 V1002)
 (cond
  ((= () V1001) 0)
  ((cons? V1001)
   (+
    (* (shen-expt 10 (- 0 V1002)) (hd V1001))
    (shen-post (tl V1001) (+ V1002 1))))
  (true (shen-sys-error 'shen-post))))

(defun
 shen-expt
 (V1005 V1006)
 (cond
  ((= 0 V1006) 1)
  ((> V1006 0) (* V1005 (shen-expt V1005 (- V1006 1))))
  (true (* 1.0 (/ (shen-expt V1005 (+ V1006 1)) V1005)))))

(defun
 shen-<st_input1>
 (V1007)
 (let
  Result
  (let
   Parse_<st_input>
   (shen-<st_input> V1007)
   (if
    (not (= (fail) Parse_<st_input>))
    (shen-reassemble (fst Parse_<st_input>) (snd Parse_<st_input>))
    (fail)))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<st_input2>
 (V1008)
 (let
  Result
  (let
   Parse_<st_input>
   (shen-<st_input> V1008)
   (if
    (not (= (fail) Parse_<st_input>))
    (shen-reassemble (fst Parse_<st_input>) (snd Parse_<st_input>))
    (fail)))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<comment>
 (V1009)
 (let
  Result
  (let
   Parse_<backslash>
   (shen-<backslash> V1009)
   (if
    (not (= (fail) Parse_<backslash>))
    (let
     Parse_<times>
     (shen-<times> Parse_<backslash>)
     (if
      (not (= (fail) Parse_<times>))
      (let
       Parse_<any>
       (shen-<any> Parse_<times>)
       (if
        (not (= (fail) Parse_<any>))
        (let
         Parse_<times>
         (shen-<times> Parse_<any>)
         (if
          (not (= (fail) Parse_<times>))
          (let
           Parse_<backslash>
           (shen-<backslash> Parse_<times>)
           (if
            (not (= (fail) Parse_<backslash>))
            (shen-reassemble (fst Parse_<backslash>) 'shen-skip)
            (fail)))
          (fail)))
        (fail)))
      (fail)))
    (fail)))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<times>
 (V1010)
 (let
  Result
  (if
   (cons? (fst V1010))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V1010)) (snd V1010)))
    (if (= (hd (fst V1010)) 42) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<any>
 (V1011)
 (let
  Result
  (let
   Parse_<comment>
   (shen-<comment> V1011)
   (if
    (not (= (fail) Parse_<comment>))
    (let
     Parse_<any>
     (shen-<any> Parse_<comment>)
     (if
      (not (= (fail) Parse_<any>))
      (shen-reassemble (fst Parse_<any>) 'shen-skip)
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<blah>
     (shen-<blah> V1011)
     (if
      (not (= (fail) Parse_<blah>))
      (let
       Parse_<any>
       (shen-<any> Parse_<blah>)
       (if
        (not (= (fail) Parse_<any>))
        (shen-reassemble (fst Parse_<any>) 'shen-skip)
        (fail)))
      (fail)))
    (if
     (= Result (fail))
     (let
      Result
      (let
       Parse_<e>
       (<e> V1011)
       (if
        (not (= (fail) Parse_<e>))
        (shen-reassemble (fst Parse_<e>) 'shen-skip)
        (fail)))
      (if (= Result (fail)) (fail) Result))
     Result))
   Result)))

(defun
 shen-<blah>
 (V1012)
 (let
  Result
  (if
   (cons? (fst V1012))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V1012)) (snd V1012)))
    (if (shen-end-of-comment? (fst V1012)) (fail) 'shen-skip))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-end-of-comment?
 (V1019)
 (cond
  ((and
    (cons? V1019)
    (and
     (= 42 (hd V1019))
     (and (cons? (tl V1019)) (= 92 (hd (tl V1019))))))
   true)
  (true false)))

(defun
 shen-<whitespaces>
 (V1020)
 (let
  Result
  (let
   Parse_<whitespace>
   (shen-<whitespace> V1020)
   (if
    (not (= (fail) Parse_<whitespace>))
    (let
     Parse_<whitespaces>
     (shen-<whitespaces> Parse_<whitespace>)
     (if
      (not (= (fail) Parse_<whitespaces>))
      (shen-reassemble (fst Parse_<whitespaces>) 'shen-skip)
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<whitespace>
     (shen-<whitespace> V1020)
     (if
      (not (= (fail) Parse_<whitespace>))
      (shen-reassemble (fst Parse_<whitespace>) 'shen-skip)
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<whitespace>
 (V1021)
 (let
  Result
  (if
   (cons? (fst V1021))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V1021)) (snd V1021)))
    (let
     Case
     (hd (fst V1021))
     (if
      (= Case 32)
      'shen-skip
      (if
       (= Case 13)
       'shen-skip
       (if
        (= Case 10)
        'shen-skip
        (if (= Case 9) 'shen-skip (fail)))))))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-cons_form
 (V1022)
 (cond
  ((= () V1022) ())
  ((and
    (cons? V1022)
    (and
     (cons? (tl V1022))
     (and
      (= 'bar! (hd (tl V1022)))
      (and (cons? (tl (tl V1022))) (= () (tl (tl (tl V1022))))))))
   (cons 'cons (cons (hd V1022) (tl (tl V1022)))))
  ((cons? V1022)
   (cons
    'cons
    (cons (hd V1022) (cons (shen-cons_form (tl V1022)) ()))))
  (true (shen-sys-error 'shen-cons_form))))

(defun
 shen-package-macro
 (V1025 V1026)
 (cond
  ((and
    (cons? V1025)
    (and
     (= 'package (hd V1025))
     (and
      (cons? (tl V1025))
      (and (= 'null (hd (tl V1025))) (cons? (tl (tl V1025)))))))
   (append (tl (tl (tl V1025))) V1026))
  ((and
    (cons? V1025)
    (and
     (= 'package (hd V1025))
     (and (cons? (tl V1025)) (cons? (tl (tl V1025))))))
   (let
    ListofExceptions
    (eval-without-macros (hd (tl (tl V1025))))
    (let
     Record
     (shen-record-exceptions ListofExceptions (hd (tl V1025)))
     (append
      (shen-packageh
       (hd (tl V1025))
       ListofExceptions
       (tl (tl (tl V1025))))
      V1026))))
  (true (cons V1025 V1026))))

(defun
 shen-record-exceptions
 (V1027 V1028)
 (let
  CurrExceptions
  (trap-error
   (get V1028 'shen-external-symbols (value 'shen-*property-vector*))
   (lambda E ()))
  (let
   AllExceptions
   (union V1027 CurrExceptions)
   (put
    V1028
    'shen-external-symbols
    AllExceptions
    (value 'shen-*property-vector*)))))

(defun
 shen-packageh
 (V1037 V1038 V1039)
 (cond
  ((cons? V1039)
   (cons
    (shen-packageh V1037 V1038 (hd V1039))
    (shen-packageh V1037 V1038 (tl V1039))))
  ((or
    (shen-sysfunc? V1039)
    (or
     (variable? V1039)
     (or
      (element? V1039 V1038)
      (or
       (shen-doubleunderline? V1039)
       (shen-singleunderline? V1039)))))
   V1039)
  ((and
    (symbol? V1039)
    (not
     (shen-prefix?
      (cons "s" (cons "h" (cons "e" (cons "n" (cons "-" ())))))
      (explode V1039))))
   (concat V1037 V1039))
  (true V1039)))

(clojure.core/comment "klambda/sequent.kl")

(defun
 shen-datatype-error
 (V1505)
 (interror
  "datatype syntax error here:~%~% ~A~%"
  (__at__p (shen-next-50 50 V1505) ())))

(defun
 shen-<datatype-rules>
 (V1506)
 (let
  Result
  (let
   Parse_<datatype-rule>
   (shen-<datatype-rule> V1506)
   (if
    (not (= (fail) Parse_<datatype-rule>))
    (let
     Parse_<datatype-rules>
     (shen-<datatype-rules> Parse_<datatype-rule>)
     (if
      (not (= (fail) Parse_<datatype-rules>))
      (shen-reassemble
       (fst Parse_<datatype-rules>)
       (cons (snd Parse_<datatype-rule>) (snd Parse_<datatype-rules>)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<e>
     (<e> V1506)
     (if
      (not (= (fail) Parse_<e>))
      (shen-reassemble (fst Parse_<e>) ())
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<datatype-rule>
 (V1507)
 (let
  Result
  (let
   Parse_<side-conditions>
   (shen-<side-conditions> V1507)
   (if
    (not (= (fail) Parse_<side-conditions>))
    (let
     Parse_<premises>
     (shen-<premises> Parse_<side-conditions>)
     (if
      (not (= (fail) Parse_<premises>))
      (let
       Parse_<singleunderline>
       (shen-<singleunderline> Parse_<premises>)
       (if
        (not (= (fail) Parse_<singleunderline>))
        (let
         Parse_<conclusion>
         (shen-<conclusion> Parse_<singleunderline>)
         (if
          (not (= (fail) Parse_<conclusion>))
          (shen-reassemble
           (fst Parse_<conclusion>)
           (__at__p
            'shen-single
            (cons
             (snd Parse_<side-conditions>)
             (cons
              (snd Parse_<premises>)
              (cons (snd Parse_<conclusion>) ())))))
          (fail)))
        (fail)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<side-conditions>
     (shen-<side-conditions> V1507)
     (if
      (not (= (fail) Parse_<side-conditions>))
      (let
       Parse_<premises>
       (shen-<premises> Parse_<side-conditions>)
       (if
        (not (= (fail) Parse_<premises>))
        (let
         Parse_<doubleunderline>
         (shen-<doubleunderline> Parse_<premises>)
         (if
          (not (= (fail) Parse_<doubleunderline>))
          (let
           Parse_<conclusion>
           (shen-<conclusion> Parse_<doubleunderline>)
           (if
            (not (= (fail) Parse_<conclusion>))
            (shen-reassemble
             (fst Parse_<conclusion>)
             (__at__p
              'shen-double
              (cons
               (snd Parse_<side-conditions>)
               (cons
                (snd Parse_<premises>)
                (cons (snd Parse_<conclusion>) ())))))
            (fail)))
          (fail)))
        (fail)))
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<side-conditions>
 (V1508)
 (let
  Result
  (let
   Parse_<side-condition>
   (shen-<side-condition> V1508)
   (if
    (not (= (fail) Parse_<side-condition>))
    (let
     Parse_<side-conditions>
     (shen-<side-conditions> Parse_<side-condition>)
     (if
      (not (= (fail) Parse_<side-conditions>))
      (shen-reassemble
       (fst Parse_<side-conditions>)
       (cons
        (snd Parse_<side-condition>)
        (snd Parse_<side-conditions>)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<e>
     (<e> V1508)
     (if
      (not (= (fail) Parse_<e>))
      (shen-reassemble (fst Parse_<e>) ())
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<side-condition>
 (V1509)
 (let
  Result
  (if
   (and (cons? (fst V1509)) (= 'if (hd (fst V1509))))
   (let
    Parse_<expr>
    (shen-<expr> (shen-reassemble (tl (fst V1509)) (snd V1509)))
    (if
     (not (= (fail) Parse_<expr>))
     (shen-reassemble
      (fst Parse_<expr>)
      (cons 'if (cons (snd Parse_<expr>) ())))
     (fail)))
   (fail))
  (if
   (= Result (fail))
   (let
    Result
    (if
     (and (cons? (fst V1509)) (= 'let (hd (fst V1509))))
     (let
      Parse_<variable?>
      (shen-<variable?> (shen-reassemble (tl (fst V1509)) (snd V1509)))
      (if
       (not (= (fail) Parse_<variable?>))
       (let
        Parse_<expr>
        (shen-<expr> Parse_<variable?>)
        (if
         (not (= (fail) Parse_<expr>))
         (shen-reassemble
          (fst Parse_<expr>)
          (cons
           'let
           (cons
            (snd Parse_<variable?>)
            (cons (snd Parse_<expr>) ()))))
         (fail)))
       (fail)))
     (fail))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<variable?>
 (V1510)
 (let
  Result
  (if
   (cons? (fst V1510))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V1510)) (snd V1510)))
    (if (not (variable? (hd (fst V1510)))) (fail) (hd (fst V1510))))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<expr>
 (V1511)
 (let
  Result
  (if
   (cons? (fst V1511))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V1511)) (snd V1511)))
    (if
     (or
      (element? (hd (fst V1511)) (cons '>> (cons (intern ";") ())))
      (or
       (shen-singleunderline? (hd (fst V1511)))
       (shen-doubleunderline? (hd (fst V1511)))))
     (fail)
     (shen-remove-bar (hd (fst V1511)))))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-remove-bar
 (V1512)
 (cond
  ((and
    (cons? V1512)
    (and
     (cons? (tl V1512))
     (and
      (cons? (tl (tl V1512)))
      (and (= () (tl (tl (tl V1512)))) (= (hd (tl V1512)) 'bar!)))))
   (cons (hd V1512) (hd (tl (tl V1512)))))
  ((cons? V1512)
   (cons (shen-remove-bar (hd V1512)) (shen-remove-bar (tl V1512))))
  (true V1512)))

(defun
 shen-<premises>
 (V1513)
 (let
  Result
  (let
   Parse_<premise>
   (shen-<premise> V1513)
   (if
    (not (= (fail) Parse_<premise>))
    (let
     Parse_<semicolon-symbol>
     (shen-<semicolon-symbol> Parse_<premise>)
     (if
      (not (= (fail) Parse_<semicolon-symbol>))
      (let
       Parse_<premises>
       (shen-<premises> Parse_<semicolon-symbol>)
       (if
        (not (= (fail) Parse_<premises>))
        (shen-reassemble
         (fst Parse_<premises>)
         (cons (snd Parse_<premise>) (snd Parse_<premises>)))
        (fail)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<e>
     (<e> V1513)
     (if
      (not (= (fail) Parse_<e>))
      (shen-reassemble (fst Parse_<e>) ())
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<semicolon-symbol>
 (V1514)
 (let
  Result
  (if
   (cons? (fst V1514))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V1514)) (snd V1514)))
    (if (= (hd (fst V1514)) (intern ";")) 'shen-skip (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<premise>
 (V1515)
 (let
  Result
  (if
   (and (cons? (fst V1515)) (= '! (hd (fst V1515))))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V1515)) (snd V1515)))
    '!)
   (fail))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<formulae>
     (shen-<formulae> V1515)
     (if
      (not (= (fail) Parse_<formulae>))
      (if
       (and
        (cons? (fst Parse_<formulae>))
        (= '>> (hd (fst Parse_<formulae>))))
       (let
        Parse_<formula>
        (shen-<formula>
         (shen-reassemble
          (tl (fst Parse_<formulae>))
          (snd Parse_<formulae>)))
        (if
         (not (= (fail) Parse_<formula>))
         (shen-reassemble
          (fst Parse_<formula>)
          (__at__p (snd Parse_<formulae>) (snd Parse_<formula>)))
         (fail)))
       (fail))
      (fail)))
    (if
     (= Result (fail))
     (let
      Result
      (let
       Parse_<formula>
       (shen-<formula> V1515)
       (if
        (not (= (fail) Parse_<formula>))
        (shen-reassemble
         (fst Parse_<formula>)
         (__at__p () (snd Parse_<formula>)))
        (fail)))
      (if (= Result (fail)) (fail) Result))
     Result))
   Result)))

(defun
 shen-<conclusion>
 (V1516)
 (let
  Result
  (let
   Parse_<formulae>
   (shen-<formulae> V1516)
   (if
    (not (= (fail) Parse_<formulae>))
    (if
     (and
      (cons? (fst Parse_<formulae>))
      (= '>> (hd (fst Parse_<formulae>))))
     (let
      Parse_<formula>
      (shen-<formula>
       (shen-reassemble
        (tl (fst Parse_<formulae>))
        (snd Parse_<formulae>)))
      (if
       (not (= (fail) Parse_<formula>))
       (let
        Parse_<semicolon-symbol>
        (shen-<semicolon-symbol> Parse_<formula>)
        (if
         (not (= (fail) Parse_<semicolon-symbol>))
         (shen-reassemble
          (fst Parse_<semicolon-symbol>)
          (__at__p (snd Parse_<formulae>) (snd Parse_<formula>)))
         (fail)))
       (fail)))
     (fail))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<formula>
     (shen-<formula> V1516)
     (if
      (not (= (fail) Parse_<formula>))
      (let
       Parse_<semicolon-symbol>
       (shen-<semicolon-symbol> Parse_<formula>)
       (if
        (not (= (fail) Parse_<semicolon-symbol>))
        (shen-reassemble
         (fst Parse_<semicolon-symbol>)
         (__at__p () (snd Parse_<formula>)))
        (fail)))
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<formulae>
 (V1517)
 (let
  Result
  (let
   Parse_<formula>
   (shen-<formula> V1517)
   (if
    (not (= (fail) Parse_<formula>))
    (if
     (and
      (cons? (fst Parse_<formula>))
      (= 'shen- (hd (fst Parse_<formula>))))
     (let
      Parse_<formulae>
      (shen-<formulae>
       (shen-reassemble
        (tl (fst Parse_<formula>))
        (snd Parse_<formula>)))
      (if
       (not (= (fail) Parse_<formulae>))
       (shen-reassemble
        (fst Parse_<formulae>)
        (cons (snd Parse_<formula>) (snd Parse_<formulae>)))
       (fail)))
     (fail))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<formula>
     (shen-<formula> V1517)
     (if
      (not (= (fail) Parse_<formula>))
      (shen-reassemble
       (fst Parse_<formula>)
       (cons (snd Parse_<formula>) ()))
      (fail)))
    (if
     (= Result (fail))
     (let
      Result
      (let
       Parse_<e>
       (<e> V1517)
       (if
        (not (= (fail) Parse_<e>))
        (shen-reassemble (fst Parse_<e>) ())
        (fail)))
      (if (= Result (fail)) (fail) Result))
     Result))
   Result)))

(defun
 shen-<formula>
 (V1518)
 (let
  Result
  (let
   Parse_<expr>
   (shen-<expr> V1518)
   (if
    (not (= (fail) Parse_<expr>))
    (if
     (and
      (cons? (fst Parse_<expr>))
      (= (intern ":") (hd (fst Parse_<expr>))))
     (let
      Parse_<type>
      (shen-<type>
       (shen-reassemble (tl (fst Parse_<expr>)) (snd Parse_<expr>)))
      (if
       (not (= (fail) Parse_<type>))
       (shen-reassemble
        (fst Parse_<type>)
        (cons
         (shen-curry (snd Parse_<expr>))
         (cons
          (intern ":")
          (cons (shen-normalise-type (snd Parse_<type>)) ()))))
       (fail)))
     (fail))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<expr>
     (shen-<expr> V1518)
     (if
      (not (= (fail) Parse_<expr>))
      (shen-reassemble (fst Parse_<expr>) (snd Parse_<expr>))
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<colonsymbol>
 (V1519)
 (let
  Result
  (if
   (cons? (fst V1519))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V1519)) (snd V1519)))
    (if (= (hd (fst V1519)) (intern ";")) (hd (fst V1519)) (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<type>
 (V1520)
 (let
  Result
  (let
   Parse_<expr>
   (shen-<expr> V1520)
   (if
    (not (= (fail) Parse_<expr>))
    (shen-reassemble
     (fst Parse_<expr>)
     (shen-curry-type (snd Parse_<expr>)))
    (fail)))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<doubleunderline>
 (V1521)
 (let
  Result
  (if
   (cons? (fst V1521))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V1521)) (snd V1521)))
    (if
     (shen-doubleunderline? (hd (fst V1521)))
     (hd (fst V1521))
     (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-<singleunderline>
 (V1522)
 (let
  Result
  (if
   (cons? (fst V1522))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V1522)) (snd V1522)))
    (if
     (shen-singleunderline? (hd (fst V1522)))
     (hd (fst V1522))
     (fail)))
   (fail))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-singleunderline?
 (V1523)
 (and (symbol? V1523) (shen-sh? (str V1523))))

(defun
 shen-sh?
 (V1524)
 (cond
  ((= "_" V1524) true)
  (true (and (= (pos V1524 0) "_") (shen-sh? (tlstr V1524))))))

(defun
 shen-doubleunderline?
 (V1525)
 (and (symbol? V1525) (shen-dh? (str V1525))))

(defun
 shen-dh?
 (V1526)
 (cond
  ((= "=" V1526) true)
  (true (and (= (pos V1526 0) "=") (shen-dh? (tlstr V1526))))))

(defun
 shen-process-datatype
 (V1527 V1528)
 (shen-remember-datatype
  (shen-s-prolog (shen-rules->horn-clauses V1527 V1528))))

(defun
 shen-remember-datatype
 (V1533)
 (cond
  ((cons? V1533)
   (do
    (set
     'shen-*datatypes*
     (adjoin (hd V1533) (value 'shen-*datatypes*)))
    (do
     (set
      'shen-*alldatatypes*
      (adjoin (hd V1533) (value 'shen-*alldatatypes*)))
     (hd V1533))))
  (true (shen-sys-error 'shen-remember-datatype))))

(defun
 shen-rules->horn-clauses
 (V1536 V1537)
 (cond
  ((= () V1537) ())
  ((and
    (cons? V1537)
    (and (tuple? (hd V1537)) (= 'shen-single (fst (hd V1537)))))
   (cons
    (shen-rule->horn-clause V1536 (snd (hd V1537)))
    (shen-rules->horn-clauses V1536 (tl V1537))))
  ((and
    (cons? V1537)
    (and (tuple? (hd V1537)) (= 'shen-double (fst (hd V1537)))))
   (recur
    V1536
    (append (shen-double->singles (snd (hd V1537))) (tl V1537))))
  (true (shen-sys-error 'shen-rules->horn-clauses))))

(defun
 shen-double->singles
 (V1538)
 (cons (shen-right-rule V1538) (cons (shen-left-rule V1538) ())))

(defun shen-right-rule (V1539) (__at__p 'shen-single V1539))

(defun
 shen-left-rule
 (V1540)
 (cond
  ((and
    (cons? V1540)
    (and
     (cons? (tl V1540))
     (and
      (cons? (tl (tl V1540)))
      (and
       (tuple? (hd (tl (tl V1540))))
       (and
        (= () (fst (hd (tl (tl V1540)))))
        (= () (tl (tl (tl V1540)))))))))
   (let
    Q
    (gensym 'Qv)
    (let
     NewConclusion
     (__at__p (cons (snd (hd (tl (tl V1540)))) ()) Q)
     (let
      NewPremises
      (cons
       (__at__p
        (map (lambda V1541 (shen-right->left V1541)) (hd (tl V1540)))
        Q)
       ())
      (__at__p
       'shen-single
       (cons
        (hd V1540)
        (cons NewPremises (cons NewConclusion ()))))))))
  (true (shen-sys-error 'shen-left-rule))))

(defun
 shen-right->left
 (V1546)
 (cond
  ((and (tuple? V1546) (= () (fst V1546))) (snd V1546))
  (true (interror "syntax error with ==========~%" ()))))

(defun
 shen-rule->horn-clause
 (V1547 V1548)
 (cond
  ((and
    (cons? V1548)
    (and
     (cons? (tl V1548))
     (and
      (cons? (tl (tl V1548)))
      (and
       (tuple? (hd (tl (tl V1548))))
       (= () (tl (tl (tl V1548))))))))
   (cons
    (shen-rule->horn-clause-head V1547 (snd (hd (tl (tl V1548)))))
    (cons
     (intern ":-")
     (cons
      (shen-rule->horn-clause-body
       (hd V1548)
       (hd (tl V1548))
       (fst (hd (tl (tl V1548)))))
      ()))))
  (true (shen-sys-error 'shen-rule->horn-clause))))

(defun
 shen-rule->horn-clause-head
 (V1549 V1550)
 (cons V1549 (cons (shen-mode-ify V1550) (cons 'Context_1957 ()))))

(defun
 shen-mode-ify
 (V1551)
 (cond
  ((and
    (cons? V1551)
    (and
     (cons? (tl V1551))
     (and
      (= (intern ":") (hd (tl V1551)))
      (and (cons? (tl (tl V1551))) (= () (tl (tl (tl V1551))))))))
   (cons
    'mode
    (cons
     (cons
      (hd V1551)
      (cons
       (intern ":")
       (cons
        (cons 'mode (cons (hd (tl (tl V1551))) (cons '+ ())))
        ())))
     (cons '- ()))))
  (true V1551)))

(defun
 shen-rule->horn-clause-body
 (V1552 V1553 V1554)
 (let
  Variables
  (map (lambda V1555 (shen-extract_vars V1555)) V1554)
  (let
   Predicates
   (map (lambda X (gensym 'shen-cl)) V1554)
   (let
    SearchLiterals
    (shen-construct-search-literals
     Predicates
     Variables
     'Context_1957
     'Context1_1957)
    (let
     SearchClauses
     (shen-construct-search-clauses Predicates V1554 Variables)
     (let
      SideLiterals
      (shen-construct-side-literals V1552)
      (let
       PremissLiterals
       (map
        (lambda X (shen-construct-premiss-literal X (empty? V1554)))
        V1553)
       (append
        SearchLiterals
        (append SideLiterals PremissLiterals)))))))))

(defun
 shen-construct-search-literals
 (V1560 V1561 V1562 V1563)
 (cond
  ((and (= () V1560) (= () V1561)) ())
  (true (shen-csl-help V1560 V1561 V1562 V1563))))

(defun
 shen-csl-help
 (V1566 V1567 V1568 V1569)
 (cond
  ((and (= () V1566) (= () V1567))
   (cons (cons 'bind (cons 'ContextOut_1957 (cons V1568 ()))) ()))
  ((and (cons? V1566) (cons? V1567))
   (cons
    (cons (hd V1566) (cons V1568 (cons V1569 (hd V1567))))
    (shen-csl-help (tl V1566) (tl V1567) V1569 (gensym 'Context))))
  (true (shen-sys-error 'shen-csl-help))))

(defun
 shen-construct-search-clauses
 (V1570 V1571 V1572)
 (cond
  ((and (= () V1570) (and (= () V1571) (= () V1572))) 'shen-skip)
  ((and (cons? V1570) (and (cons? V1571) (cons? V1572)))
   (do
    (shen-construct-search-clause (hd V1570) (hd V1571) (hd V1572))
    (shen-construct-search-clauses (tl V1570) (tl V1571) (tl V1572))))
  (true (shen-sys-error 'shen-construct-search-clauses))))

(defun
 shen-construct-search-clause
 (V1573 V1574 V1575)
 (shen-s-prolog
  (cons
   (shen-construct-base-search-clause V1573 V1574 V1575)
   (cons
    (shen-construct-recursive-search-clause V1573 V1574 V1575)
    ()))))

(defun
 shen-construct-base-search-clause
 (V1576 V1577 V1578)
 (cons
  (cons
   V1576
   (cons (cons (shen-mode-ify V1577) 'In_1957) (cons 'In_1957 V1578)))
  (cons (intern ":-") (cons () ()))))

(defun
 shen-construct-recursive-search-clause
 (V1579 V1580 V1581)
 (cons
  (cons
   V1579
   (cons
    (cons 'Assumption_1957 'Assumptions_1957)
    (cons (cons 'Assumption_1957 'Out_1957) V1581)))
  (cons
   (intern ":-")
   (cons
    (cons
     (cons V1579 (cons 'Assumptions_1957 (cons 'Out_1957 V1581)))
     ())
    ()))))

(defun
 shen-construct-side-literals
 (V1586)
 (cond
  ((= () V1586) ())
  ((and
    (cons? V1586)
    (and
     (cons? (hd V1586))
     (and
      (= 'if (hd (hd V1586)))
      (and (cons? (tl (hd V1586))) (= () (tl (tl (hd V1586))))))))
   (cons
    (cons 'when (tl (hd V1586)))
    (shen-construct-side-literals (tl V1586))))
  ((and
    (cons? V1586)
    (and
     (cons? (hd V1586))
     (and
      (= 'let (hd (hd V1586)))
      (and
       (cons? (tl (hd V1586)))
       (and
        (cons? (tl (tl (hd V1586))))
        (= () (tl (tl (tl (hd V1586))))))))))
   (cons
    (cons 'is (tl (hd V1586)))
    (shen-construct-side-literals (tl V1586))))
  ((cons? V1586) (recur (tl V1586)))
  (true (shen-sys-error 'shen-construct-side-literals))))

(defun
 shen-construct-premiss-literal
 (V1591 V1592)
 (cond
  ((tuple? V1591)
   (cons
    'shen-t*
    (cons
     (shen-recursive_cons_form (snd V1591))
     (cons (shen-construct-context V1592 (fst V1591)) ()))))
  ((= '! V1591) (cons 'cut (cons 'Throwcontrol ())))
  (true (shen-sys-error 'shen-construct-premiss-literal))))

(defun
 shen-construct-context
 (V1593 V1594)
 (cond
  ((and (= true V1593) (= () V1594)) 'Context_1957)
  ((and (= false V1593) (= () V1594)) 'ContextOut_1957)
  ((cons? V1594)
   (cons
    'cons
    (cons
     (shen-recursive_cons_form (hd V1594))
     (cons (shen-construct-context V1593 (tl V1594)) ()))))
  (true (shen-sys-error 'shen-construct-context))))

(defun
 shen-recursive_cons_form
 (V1595)
 (cond
  ((cons? V1595)
   (cons
    'cons
    (cons
     (shen-recursive_cons_form (hd V1595))
     (cons (shen-recursive_cons_form (tl V1595)) ()))))
  (true V1595)))

(defun
 preclude
 (V1596)
 (let
  FilterDatatypes
  (set 'shen-*datatypes* (difference (value 'shen-*datatypes*) V1596))
  (value 'shen-*datatypes*)))

(defun
 include
 (V1597)
 (let
  ValidTypes
  (intersection V1597 (value 'shen-*alldatatypes*))
  (let
   NewDatatypes
   (set 'shen-*datatypes* (union ValidTypes (value 'shen-*datatypes*)))
   (value 'shen-*datatypes*))))

(defun
 preclude-all-but
 (V1598)
 (preclude (difference (value 'shen-*alldatatypes*) V1598)))

(defun
 include-all-but
 (V1599)
 (include (difference (value 'shen-*alldatatypes*) V1599)))

(defun
 shen-synonyms-help
 (V1604)
 (cond
  ((= () V1604) 'synonyms)
  ((and (cons? V1604) (cons? (tl V1604)))
   (do
    (shen-pushnew (cons (hd V1604) (hd (tl V1604))) 'shen-*synonyms*)
    (shen-synonyms-help (tl (tl V1604)))))
  (true (interror "odd number of synonyms~%" (__at__p () ())))))

(defun
 shen-pushnew
 (V1605 V1606)
 (if
  (element? V1605 (value V1606))
  (value V1606)
  (set V1606 (cons V1605 (value V1606)))))

(clojure.core/comment "klambda/toplevel.kl")

(defun shen-shen () (do (shen-credits) (shen-kl_loop)))

(defun
 shen-kl_loop
 ()
 (do
  (shen-initialise_environment)
  (do
   (shen-prompt)
   (do
    (trap-error
     (shen-read-evaluate-print)
     (lambda E (pr (error-to-string E) (value '*stinput*))))
    (recur)))))

(defun version (V547) (set '*version* V547))

(version "version 3.2")

(defun
 shen-credits
 ()
 (do
  (intoutput "~%Shen 2010, copyright (C) 2010 Mark Tarver~%" ())
  (do
   (intoutput
    "www.shenlanguage.org, ~A~%"
    (__at__p (value '*version*) ()))
   (do
    (intoutput
     "running under ~A, implementation: ~A"
     (__at__p
      (value '*language*)
      (__at__p (value '*implementation*) ())))
    (intoutput
     "~%port ~A ported by ~A~%"
     (__at__p (value '*port*) (__at__p (value '*porters*) ())))))))

(defun
 shen-initialise_environment
 ()
 (shen-multiple-set
  (cons
   'shen-*call*
   (cons
    0
    (cons
     'shen-*infs*
     (cons
      0
      (cons
       'shen-*dumped*
       (cons
        ()
        (cons
         'shen-*process-counter*
         (cons 0 (cons 'shen-*catch* (cons 0 ()))))))))))))

(defun
 shen-multiple-set
 (V548)
 (cond
  ((= () V548) ())
  ((and (cons? V548) (cons? (tl V548)))
   (do
    (set (hd V548) (hd (tl V548)))
    (shen-multiple-set (tl (tl V548)))))
  (true (shen-sys-error 'shen-multiple-set))))

(defun destroy (V549) (declare V549 ()))

(set 'shen-*history* ())

(defun
 shen-read-evaluate-print
 ()
 (let
  Lineread
  (shen-toplineread)
  (let
   History
   (value 'shen-*history*)
   (let
    NewLineread
    (shen-retrieve-from-history-if-needed Lineread History)
    (let
     NewHistory
     (shen-update_history NewLineread History)
     (let Parsed (fst NewLineread) (shen-toplevel Parsed)))))))

(defun
 shen-retrieve-from-history-if-needed
 (V559 V560)
 (cond
  ((and
    (tuple? V559)
    (and
     (cons? (snd V559))
     (and
      (cons? (tl (snd V559)))
      (and
       (= () (tl (tl (snd V559))))
       (and
        (cons? V560)
        (and
         (= (hd (snd V559)) (shen-exclamation))
         (= (hd (tl (snd V559))) (shen-exclamation))))))))
   (let PastPrint (shen-prbytes (snd (hd V560))) (hd V560)))
  ((and
    (tuple? V559)
    (and (cons? (snd V559)) (= (hd (snd V559)) (shen-exclamation))))
   (let
    Key?
    (shen-make-key (tl (snd V559)) V560)
    (let
     Find
     (head (shen-find-past-inputs Key? V560))
     (let PastPrint (shen-prbytes (snd Find)) Find))))
  ((and
    (tuple? V559)
    (and
     (cons? (snd V559))
     (and (= () (tl (snd V559))) (= (hd (snd V559)) (shen-percent)))))
   (do
    (shen-print-past-inputs (lambda X true) (reverse V560) 0)
    (abort)))
  ((and
    (tuple? V559)
    (and (cons? (snd V559)) (= (hd (snd V559)) (shen-percent))))
   (let
    Key?
    (shen-make-key (tl (snd V559)) V560)
    (let
     Pastprint
     (shen-print-past-inputs Key? (reverse V560) 0)
     (abort))))
  (true V559)))

(defun shen-percent () 37)

(defun shen-exclamation () 33)

(defun
 shen-prbytes
 (V561)
 (do
  (map (lambda Byte (pr (n->string Byte) (stinput 0))) V561)
  (nl 1)))

(defun
 shen-update_history
 (V562 V563)
 (set 'shen-*history* (cons V562 V563)))

(defun
 shen-toplineread
 ()
 (shen-toplineread_loop (read-byte (stinput 0)) ()))

(defun
 shen-toplineread_loop
 (V565 V566)
 (cond
  ((= V565 (shen-hat)) (interror "line read aborted" ()))
  ((element?
    V565
    (cons (shen-newline) (cons (shen-carriage-return) ())))
   (let
    Line
    (compile (lambda V567 (shen-<st_input> V567)) V566 ())
    (if
     (or (= Line 'fail!) (empty? Line))
     (shen-toplineread_loop
      (read-byte (stinput 0))
      (append V566 (cons V565 ())))
     (__at__p Line V566))))
  (true (recur (read-byte (stinput 0)) (append V566 (cons V565 ()))))))

(defun shen-hat () 94)

(defun shen-newline () 10)

(defun shen-carriage-return () 13)

(defun
 tc
 (V572)
 (cond
  ((= '+ V572) (set 'shen-*tc* true))
  ((= '- V572) (set 'shen-*tc* false))
  (true (interror "tc expects a + or -" ()))))

(defun
 shen-prompt
 ()
 (if
  (value 'shen-*tc*)
  (intoutput
   "~%~%(~A+) "
   (__at__p (length (value 'shen-*history*)) ()))
  (intoutput
   "~%~%(~A-) "
   (__at__p (length (value 'shen-*history*)) ()))))

(defun
 shen-toplevel
 (V573)
 (shen-toplevel_evaluate V573 (value 'shen-*tc*)))

(defun
 shen-find-past-inputs
 (V574 V575)
 (let
  F
  (shen-find V574 V575)
  (if (empty? F) (interror "input not found~%" ()) F)))

(defun
 shen-make-key
 (V576 V577)
 (let
  Atom
  (hd (compile (lambda V578 (shen-<st_input> V578)) V576 ()))
  (if
   (integer? Atom)
   (lambda X (= X (nth (+ Atom 1) (reverse V577))))
   (lambda X (shen-prefix? V576 (shen-trim-gubbins (snd X)))))))

(defun
 shen-trim-gubbins
 (V579)
 (cond
  ((and (cons? V579) (= (hd V579) (shen-space))) (recur (tl V579)))
  ((and (cons? V579) (= (hd V579) (shen-newline))) (recur (tl V579)))
  ((and (cons? V579) (= (hd V579) (shen-carriage-return)))
   (recur (tl V579)))
  ((and (cons? V579) (= (hd V579) (shen-tab))) (recur (tl V579)))
  ((and (cons? V579) (= (hd V579) (shen-left-round)))
   (recur (tl V579)))
  (true V579)))

(defun shen-space () 32)

(defun shen-tab () 9)

(defun shen-left-round () 40)

(defun
 shen-find
 (V586 V587)
 (cond
  ((= () V587) ())
  ((and (cons? V587) ((function V586) (hd V587)))
   (cons (hd V587) (shen-find V586 (tl V587))))
  ((cons? V587) (recur V586 (tl V587)))
  (true (shen-sys-error 'shen-find))))

(defun
 shen-prefix?
 (V598 V599)
 (cond
  ((= () V598) true)
  ((and (cons? V598) (and (cons? V599) (= (hd V599) (hd V598))))
   (recur (tl V598) (tl V599)))
  (true false)))

(defun
 shen-print-past-inputs
 (V609 V610 V611)
 (cond
  ((= () V610) '_)
  ((and (cons? V610) (not ((function V609) (hd V610))))
   (recur V609 (tl V610) (+ V611 1)))
  ((and (cons? V610) (tuple? (hd V610)))
   (do
    (intoutput "~A. " (__at__p V611 ()))
    (do
     (shen-prbytes (snd (hd V610)))
     (shen-print-past-inputs V609 (tl V610) (+ V611 1)))))
  (true (shen-sys-error 'shen-print-past-inputs))))

(defun
 shen-toplevel_evaluate
 (V612 V613)
 (cond
  ((and
    (cons? V612)
    (and
     (cons? (tl V612))
     (and
      (= (intern ":") (hd (tl V612)))
      (and
       (cons? (tl (tl V612)))
       (and (= () (tl (tl (tl V612)))) (= true V613))))))
   (shen-typecheck-and-evaluate (hd V612) (hd (tl (tl V612)))))
  ((and (cons? V612) (cons? (tl V612)))
   (do
    (shen-toplevel_evaluate (cons (hd V612) ()) V613)
    (do
     (if (= (value 'shen-*hush*) 'shen-hushed) 'shen-skip (nl 1))
     (shen-toplevel_evaluate (tl V612) V613))))
  ((and (cons? V612) (and (= () (tl V612)) (= true V613)))
   (shen-typecheck-and-evaluate (hd V612) (gensym 'A)))
  ((and (cons? V612) (and (= () (tl V612)) (= false V613)))
   (let
    Eval
    (eval-without-macros (hd V612))
    (if
     (or (= (value 'shen-*hush*) 'shen-hushed) (= Eval 'shen-unhushed))
     'shen-skip
     (print Eval))))
  (true (shen-sys-error 'shen-toplevel_evaluate))))

(defun
 shen-typecheck-and-evaluate
 (V614 V615)
 (let
  Typecheck
  (shen-typecheck V614 V615)
  (if
   (= Typecheck false)
   (interror "type error~%" ())
   (let
    Eval
    (eval-without-macros V614)
    (let
     Type
     (shen-pretty-type Typecheck)
     (if
      (or
       (= (value 'shen-*hush*) 'shen-hushed)
       (= V614 'shen-unhushed))
      'shen-skip
      (intoutput "~S : ~R" (__at__p Eval (__at__p Type ())))))))))

(defun
 shen-pretty-type
 (V616)
 (shen-mult_subst
  (value 'shen-*alphabet*)
  (shen-extract-pvars V616)
  V616))

(defun
 shen-extract-pvars
 (V621)
 (cond
  ((shen-pvar? V621) (cons V621 ()))
  ((cons? V621)
   (union
    (shen-extract-pvars (hd V621))
    (shen-extract-pvars (tl V621))))
  (true ())))

(defun
 shen-mult_subst
 (V626 V627 V628)
 (cond
  ((= () V626) V628)
  ((= () V627) V628)
  ((and (cons? V626) (cons? V627))
   (recur (tl V626) (tl V627) (subst (hd V626) (hd V627) V628)))
  (true (shen-sys-error 'shen-mult_subst))))

(clojure.core/comment "klambda/track.kl")

(defun
 shen-f_error
 (V1082)
 (do
  (intoutput "partial function ~A;~%" (__at__p V1082 ()))
  (do
   (if
    (and
     (not (shen-tracked? V1082))
     (y-or-n? (intmake-string "track ~A? " (__at__p V1082 ()))))
    (shen-track-function (ps V1082))
    'shen-ok)
   (simple-error "aborted"))))

(defun shen-tracked? (V1083) (element? V1083 (value 'shen-*tracking*)))

(defun
 track
 (V1084)
 (let Source (ps V1084) (shen-track-function Source)))

(defun
 shen-track-function
 (V1085)
 (cond
  ((and
    (cons? V1085)
    (and
     (= 'defun (hd V1085))
     (and
      (cons? (tl V1085))
      (and
       (cons? (tl (tl V1085)))
       (and
        (cons? (tl (tl (tl V1085))))
        (= () (tl (tl (tl (tl V1085))))))))))
   (let
    KL
    (cons
     'defun
     (cons
      (hd (tl V1085))
      (cons
       (hd (tl (tl V1085)))
       (cons
        (shen-insert-tracking-code
         (hd (tl V1085))
         (hd (tl (tl V1085)))
         (hd (tl (tl (tl V1085)))))
        ()))))
    (let
     Ob
     (eval KL)
     (let
      Tr
      (set 'shen-*tracking* (cons Ob (value 'shen-*tracking*)))
      Ob))))
  (true (shen-sys-error 'shen-track-function))))

(defun
 shen-insert-tracking-code
 (V1086 V1087 V1088)
 (cons
  'do
  (cons
   (cons
    'set
    (cons
     'shen-*call*
     (cons
      (cons '+ (cons (cons 'value (cons 'shen-*call* ())) (cons 1 ())))
      ())))
   (cons
    (cons
     'do
     (cons
      (cons
       'shen-input-track
       (cons
        (cons 'value (cons 'shen-*call* ()))
        (cons V1086 (cons (shen-cons_form V1087) ()))))
      (cons
       (cons
        'do
        (cons
         (cons 'shen-terpri-or-read-char ())
         (cons
          (cons
           'let
           (cons
            'Result
            (cons
             V1088
             (cons
              (cons
               'do
               (cons
                (cons
                 'shen-output-track
                 (cons
                  (cons 'value (cons 'shen-*call* ()))
                  (cons V1086 (cons 'Result ()))))
                (cons
                 (cons
                  'do
                  (cons
                   (cons
                    'set
                    (cons
                     'shen-*call*
                     (cons
                      (cons
                       '-
                       (cons
                        (cons 'value (cons 'shen-*call* ()))
                        (cons 1 ())))
                      ())))
                   (cons
                    (cons
                     'do
                     (cons
                      (cons 'shen-terpri-or-read-char ())
                      (cons 'Result ())))
                    ())))
                 ())))
              ()))))
          ())))
       ())))
    ()))))

(set 'shen-*step* false)

(defun
 step
 (V1093)
 (cond
  ((= '+ V1093) (set 'shen-*step* true))
  ((= '- V1093) (set 'shen-*step* false))
  (true (interror "step expects a + or a -.~%" ()))))

(defun
 spy
 (V1098)
 (cond
  ((= '+ V1098) (set 'shen-*spy* true))
  ((= '- V1098) (set 'shen-*spy* false))
  (true (interror "spy expects a + or a -.~%" ()))))

(defun
 shen-terpri-or-read-char
 ()
 (if
  (value 'shen-*step*)
  (shen-check-byte (read-byte (value '*stinput*)))
  (nl 1)))

(defun
 shen-check-byte
 (V1103)
 (cond ((= V1103 (shen-hat)) (interror "aborted" ())) (true true)))

(defun
 shen-input-track
 (V1104 V1105 V1106)
 (do
  (intoutput
   "~%~A<~A> Inputs to ~A ~%~A"
   (__at__p
    (shen-spaces V1104)
    (__at__p
     V1104
     (__at__p
      V1105
      (__at__p (shen-spaces V1104) (__at__p V1106 ()))))))
  (shen-recursively-print V1106)))

(defun
 shen-recursively-print
 (V1107)
 (cond
  ((= () V1107) (intoutput " ==>" ()))
  ((cons? V1107)
   (do
    (print (hd V1107))
    (do (intoutput ", " ()) (shen-recursively-print (tl V1107)))))
  (true (shen-sys-error 'shen-recursively-print))))

(defun
 shen-spaces
 (V1108)
 (cond ((= 0 V1108) "") (true (cn " " (shen-spaces (- V1108 1))))))

(defun
 shen-output-track
 (V1109 V1110 V1111)
 (intoutput
  "~%~A<~A> Output from ~A ~%~A==> ~S"
  (__at__p
   (shen-spaces V1109)
   (__at__p
    V1109
    (__at__p
     V1110
     (__at__p (shen-spaces V1109) (__at__p V1111 ())))))))

(defun untrack (V1112) (eval (ps V1112)))

(defun profile (V1113) (shen-profile-help (ps V1113)))

(defun
 shen-profile-help
 (V1118)
 (cond
  ((and
    (cons? V1118)
    (and
     (= 'defun (hd V1118))
     (and
      (cons? (tl V1118))
      (and
       (cons? (tl (tl V1118)))
       (and
        (cons? (tl (tl (tl V1118))))
        (= () (tl (tl (tl (tl V1118))))))))))
   (let
    G
    (gensym 'shen-f)
    (let
     Profile
     (cons
      'defun
      (cons
       (hd (tl V1118))
       (cons
        (hd (tl (tl V1118)))
        (cons
         (shen-profile-func
          (hd (tl V1118))
          (hd (tl (tl V1118)))
          (cons G (hd (tl (tl V1118)))))
         ()))))
     (let
      Def
      (cons
       'defun
       (cons
        G
        (cons
         (hd (tl (tl V1118)))
         (cons
          (subst G (hd (tl V1118)) (hd (tl (tl (tl V1118)))))
          ()))))
      (let
       CompileProfile
       (eval-without-macros Profile)
       (let CompileG (eval-without-macros Def) (hd (tl V1118))))))))
  (true (interror "Cannot profile.~%" ()))))

(defun unprofile (V1119) (untrack V1119))

(defun
 shen-profile-func
 (V1120 V1121 V1122)
 (cons
  'let
  (cons
   'Start
   (cons
    (cons 'get-time (cons 'run ()))
    (cons
     (cons
      'let
      (cons
       'Result
       (cons
        V1122
        (cons
         (cons
          'let
          (cons
           'Finish
           (cons
            (cons
             '-
             (cons (cons 'get-time (cons 'run ())) (cons 'Start ())))
            (cons
             (cons
              'let
              (cons
               'Record
               (cons
                (cons
                 'shen-put-profile
                 (cons
                  V1120
                  (cons
                   (cons
                    '+
                    (cons
                     (cons 'shen-get-profile (cons V1120 ()))
                     (cons 'Finish ())))
                   ())))
                (cons 'Result ()))))
             ()))))
         ()))))
     ())))))

(defun
 profile-results
 (V1123)
 (let
  Results
  (shen-get-profile V1123)
  (let Initialise (shen-put-profile V1123 0) (__at__p V1123 Results))))

(defun
 shen-get-profile
 (V1124)
 (trap-error
  (get V1124 'profile (value 'shen-*property-vector*))
  (lambda E 0)))

(defun
 shen-put-profile
 (V1125 V1126)
 (put V1125 'profile V1126 (value 'shen-*property-vector*)))

(clojure.core/comment "klambda/t-star.kl")

(defun
 shen-typecheck
 (V761 V762)
 (let
  Curry
  (shen-curry V761)
  (let
   ProcessN
   (shen-start-new-prolog-process)
   (let
    Type
    (shen-insert-prolog-variables
     (shen-normalise-type (shen-curry-type V762))
     ProcessN)
    (let
     Continuation
     (freeze (return Type ProcessN 'shen-void))
     (shen-th* Curry Type () ProcessN Continuation))))))

(defun
 shen-curry
 (V763)
 (cond
  ((and (cons? V763) (shen-special? (hd V763)))
   (cons (hd V763) (map (lambda X (shen-curry X)) (tl V763))))
  ((and
    (cons? V763)
    (and (cons? (tl V763)) (shen-extraspecial? (hd V763))))
   V763)
  ((and (cons? V763) (and (cons? (tl V763)) (cons? (tl (tl V763)))))
   (recur
    (cons (cons (hd V763) (cons (hd (tl V763)) ())) (tl (tl V763)))))
  ((and (cons? V763) (and (cons? (tl V763)) (= () (tl (tl V763)))))
   (cons (shen-curry (hd V763)) (cons (shen-curry (hd (tl V763))) ())))
  (true V763)))

(defun shen-special? (V764) (element? V764 (value 'shen-*special*)))

(defun
 shen-extraspecial?
 (V765)
 (element? V765 (value 'shen-*extraspecial*)))

(defun
 shen-t*
 (V550 V551 V552 V553)
 (let
  Throwcontrol
  (shen-catchpoint)
  (shen-cutpoint
   Throwcontrol
   (let
    Case
    (let
     Error
     (shen-newpv V552)
     (do
      (shen-incinfs)
      (fwhen
       (shen-maxinfexceeded?)
       V552
       (freeze (bind Error (shen-errormaxinfs) V552 V553)))))
    (if
     (= Case false)
     (let
      Case
      (let
       V544
       (shen-lazyderef V550 V552)
       (if
        (= 'fail V544)
        (do
         (shen-incinfs)
         (cut
          Throwcontrol
          V552
          (freeze (shen-prolog-failure V552 V553))))
        false))
      (if
       (= Case false)
       (let
        Case
        (let
         V545
         (shen-lazyderef V550 V552)
         (if
          (cons? V545)
          (let
           X
           (hd V545)
           (let
            V546
            (shen-lazyderef (tl V545) V552)
            (if
             (cons? V546)
             (let
              V547
              (shen-lazyderef (hd V546) V552)
              (if
               (= (intern ":") V547)
               (let
                V548
                (shen-lazyderef (tl V546) V552)
                (if
                 (cons? V548)
                 (let
                  A
                  (hd V548)
                  (let
                   V549
                   (shen-lazyderef (tl V548) V552)
                   (if
                    (= () V549)
                    (do
                     (shen-incinfs)
                     (cut
                      Throwcontrol
                      V552
                      (freeze (shen-th* X A V551 V552 V553))))
                    false)))
                 false))
               false))
             false)))
          false))
        (if
         (= Case false)
         (let
          Hyps
          (shen-newpv V552)
          (let
           Datatypes
           (shen-newpv V552)
           (do
            (shen-incinfs)
            (shen-show
             V550
             Hyps
             V552
             (freeze
              (bind
               Datatypes
               (value 'shen-*datatypes*)
               V552
               (freeze
                (shen-udefs* V550 V551 Datatypes V552 V553))))))))
         Case))
       Case))
     Case)))))

(defun shen-prolog-failure (V584 V585) false)

(defun
 shen-maxinfexceeded?
 ()
 (> (inferences 'shen-skip) (value 'shen-*maxinferences*)))

(defun
 shen-errormaxinfs
 ()
 (simple-error "maximum inferences exceeded~%"))

(defun
 shen-udefs*
 (V773 V774 V775 V776 V777)
 (let
  Case
  (let
   V749
   (shen-lazyderef V775 V776)
   (if
    (cons? V749)
    (let
     D
     (hd V749)
     (do
      (shen-incinfs)
      (call (cons D (cons V773 (cons V774 ()))) V776 V777)))
    false))
  (if
   (= Case false)
   (let
    V750
    (shen-lazyderef V775 V776)
    (if
     (cons? V750)
     (let
      Ds
      (tl V750)
      (do (shen-incinfs) (recur V773 V774 Ds V776 V777)))
     false))
   Case)))

(defun
 shen-th*
 (V786 V787 V788 V789 V790)
 (let
  Throwcontrol
  (shen-catchpoint)
  (shen-cutpoint
   Throwcontrol
   (let
    Case
    (do
     (shen-incinfs)
     (shen-show
      (cons V786 (cons (intern ":") (cons V787 ())))
      V788
      V789
      (freeze (fwhen false V789 V790))))
    (if
     (= Case false)
     (let
      Case
      (let
       F
       (shen-newpv V789)
       (do
        (shen-incinfs)
        (fwhen
         (shen-typedf? (shen-lazyderef V786 V789))
         V789
         (freeze
          (bind
           F
           (shen-sigf (shen-lazyderef V786 V789))
           V789
           (freeze (call (cons F (cons V787 ())) V789 V790)))))))
      (if
       (= Case false)
       (let
        Case
        (do (shen-incinfs) (shen-base V786 V787 V789 V790))
        (if
         (= Case false)
         (let
          Case
          (do
           (shen-incinfs)
           (shen-by_hypothesis V786 V787 V788 V789 V790))
          (if
           (= Case false)
           (let
            Case
            (let
             V678
             (shen-lazyderef V786 V789)
             (if
              (cons? V678)
              (let
               F
               (hd V678)
               (let
                V679
                (shen-lazyderef (tl V678) V789)
                (if
                 (cons? V679)
                 (let
                  X
                  (hd V679)
                  (let
                   V680
                   (shen-lazyderef (tl V679) V789)
                   (if
                    (= () V680)
                    (let
                     B
                     (shen-newpv V789)
                     (do
                      (shen-incinfs)
                      (shen-th*
                       F
                       (cons B (cons '--> (cons V787 ())))
                       V788
                       V789
                       (freeze (shen-th* X B V788 V789 V790)))))
                    false)))
                 false)))
              false))
            (if
             (= Case false)
             (let
              Case
              (let
               V681
               (shen-lazyderef V786 V789)
               (if
                (cons? V681)
                (let
                 V682
                 (shen-lazyderef (hd V681) V789)
                 (if
                  (= 'cons V682)
                  (let
                   V683
                   (shen-lazyderef (tl V681) V789)
                   (if
                    (cons? V683)
                    (let
                     X
                     (hd V683)
                     (let
                      V684
                      (shen-lazyderef (tl V683) V789)
                      (if
                       (cons? V684)
                       (let
                        Y
                        (hd V684)
                        (let
                         V685
                         (shen-lazyderef (tl V684) V789)
                         (if
                          (= () V685)
                          (let
                           V686
                           (shen-lazyderef V787 V789)
                           (if
                            (cons? V686)
                            (let
                             V687
                             (shen-lazyderef (hd V686) V789)
                             (if
                              (= 'list V687)
                              (let
                               V688
                               (shen-lazyderef (tl V686) V789)
                               (if
                                (cons? V688)
                                (let
                                 A
                                 (hd V688)
                                 (let
                                  V689
                                  (shen-lazyderef (tl V688) V789)
                                  (if
                                   (= () V689)
                                   (do
                                    (shen-incinfs)
                                    (shen-th*
                                     X
                                     A
                                     V788
                                     V789
                                     (freeze
                                      (shen-th*
                                       Y
                                       (cons 'list (cons A ()))
                                       V788
                                       V789
                                       V790))))
                                   (if
                                    (shen-pvar? V689)
                                    (do
                                     (shen-bindv V689 () V789)
                                     (let
                                      Result
                                      (do
                                       (shen-incinfs)
                                       (shen-th*
                                        X
                                        A
                                        V788
                                        V789
                                        (freeze
                                         (shen-th*
                                          Y
                                          (cons 'list (cons A ()))
                                          V788
                                          V789
                                          V790))))
                                      (do
                                       (shen-unbindv V689 V789)
                                       Result)))
                                    false))))
                                (if
                                 (shen-pvar? V688)
                                 (let
                                  A
                                  (shen-newpv V789)
                                  (do
                                   (shen-bindv V688 (cons A ()) V789)
                                   (let
                                    Result
                                    (do
                                     (shen-incinfs)
                                     (shen-th*
                                      X
                                      A
                                      V788
                                      V789
                                      (freeze
                                       (shen-th*
                                        Y
                                        (cons 'list (cons A ()))
                                        V788
                                        V789
                                        V790))))
                                    (do
                                     (shen-unbindv V688 V789)
                                     Result))))
                                 false)))
                              (if
                               (shen-pvar? V687)
                               (do
                                (shen-bindv V687 'list V789)
                                (let
                                 Result
                                 (let
                                  V690
                                  (shen-lazyderef (tl V686) V789)
                                  (if
                                   (cons? V690)
                                   (let
                                    A
                                    (hd V690)
                                    (let
                                     V691
                                     (shen-lazyderef (tl V690) V789)
                                     (if
                                      (= () V691)
                                      (do
                                       (shen-incinfs)
                                       (shen-th*
                                        X
                                        A
                                        V788
                                        V789
                                        (freeze
                                         (shen-th*
                                          Y
                                          (cons 'list (cons A ()))
                                          V788
                                          V789
                                          V790))))
                                      (if
                                       (shen-pvar? V691)
                                       (do
                                        (shen-bindv V691 () V789)
                                        (let
                                         Result
                                         (do
                                          (shen-incinfs)
                                          (shen-th*
                                           X
                                           A
                                           V788
                                           V789
                                           (freeze
                                            (shen-th*
                                             Y
                                             (cons 'list (cons A ()))
                                             V788
                                             V789
                                             V790))))
                                         (do
                                          (shen-unbindv V691 V789)
                                          Result)))
                                       false))))
                                   (if
                                    (shen-pvar? V690)
                                    (let
                                     A
                                     (shen-newpv V789)
                                     (do
                                      (shen-bindv
                                       V690
                                       (cons A ())
                                       V789)
                                      (let
                                       Result
                                       (do
                                        (shen-incinfs)
                                        (shen-th*
                                         X
                                         A
                                         V788
                                         V789
                                         (freeze
                                          (shen-th*
                                           Y
                                           (cons 'list (cons A ()))
                                           V788
                                           V789
                                           V790))))
                                       (do
                                        (shen-unbindv V690 V789)
                                        Result))))
                                    false)))
                                 (do (shen-unbindv V687 V789) Result)))
                               false)))
                            (if
                             (shen-pvar? V686)
                             (let
                              A
                              (shen-newpv V789)
                              (do
                               (shen-bindv
                                V686
                                (cons 'list (cons A ()))
                                V789)
                               (let
                                Result
                                (do
                                 (shen-incinfs)
                                 (shen-th*
                                  X
                                  A
                                  V788
                                  V789
                                  (freeze
                                   (shen-th*
                                    Y
                                    (cons 'list (cons A ()))
                                    V788
                                    V789
                                    V790))))
                                (do (shen-unbindv V686 V789) Result))))
                             false)))
                          false)))
                       false)))
                    false))
                  false))
                false))
              (if
               (= Case false)
               (let
                Case
                (let
                 V692
                 (shen-lazyderef V786 V789)
                 (if
                  (cons? V692)
                  (let
                   V693
                   (shen-lazyderef (hd V692) V789)
                   (if
                    (= '__at__p V693)
                    (let
                     V694
                     (shen-lazyderef (tl V692) V789)
                     (if
                      (cons? V694)
                      (let
                       X
                       (hd V694)
                       (let
                        V695
                        (shen-lazyderef (tl V694) V789)
                        (if
                         (cons? V695)
                         (let
                          Y
                          (hd V695)
                          (let
                           V696
                           (shen-lazyderef (tl V695) V789)
                           (if
                            (= () V696)
                            (let
                             V697
                             (shen-lazyderef V787 V789)
                             (if
                              (cons? V697)
                              (let
                               A
                               (hd V697)
                               (let
                                V698
                                (shen-lazyderef (tl V697) V789)
                                (if
                                 (cons? V698)
                                 (let
                                  V699
                                  (shen-lazyderef (hd V698) V789)
                                  (if
                                   (= '* V699)
                                   (let
                                    V700
                                    (shen-lazyderef (tl V698) V789)
                                    (if
                                     (cons? V700)
                                     (let
                                      B
                                      (hd V700)
                                      (let
                                       V701
                                       (shen-lazyderef (tl V700) V789)
                                       (if
                                        (= () V701)
                                        (do
                                         (shen-incinfs)
                                         (shen-th*
                                          X
                                          A
                                          V788
                                          V789
                                          (freeze
                                           (shen-th*
                                            Y
                                            B
                                            V788
                                            V789
                                            V790))))
                                        (if
                                         (shen-pvar? V701)
                                         (do
                                          (shen-bindv V701 () V789)
                                          (let
                                           Result
                                           (do
                                            (shen-incinfs)
                                            (shen-th*
                                             X
                                             A
                                             V788
                                             V789
                                             (freeze
                                              (shen-th*
                                               Y
                                               B
                                               V788
                                               V789
                                               V790))))
                                           (do
                                            (shen-unbindv V701 V789)
                                            Result)))
                                         false))))
                                     (if
                                      (shen-pvar? V700)
                                      (let
                                       B
                                       (shen-newpv V789)
                                       (do
                                        (shen-bindv
                                         V700
                                         (cons B ())
                                         V789)
                                        (let
                                         Result
                                         (do
                                          (shen-incinfs)
                                          (shen-th*
                                           X
                                           A
                                           V788
                                           V789
                                           (freeze
                                            (shen-th*
                                             Y
                                             B
                                             V788
                                             V789
                                             V790))))
                                         (do
                                          (shen-unbindv V700 V789)
                                          Result))))
                                      false)))
                                   (if
                                    (shen-pvar? V699)
                                    (do
                                     (shen-bindv V699 '* V789)
                                     (let
                                      Result
                                      (let
                                       V702
                                       (shen-lazyderef (tl V698) V789)
                                       (if
                                        (cons? V702)
                                        (let
                                         B
                                         (hd V702)
                                         (let
                                          V703
                                          (shen-lazyderef
                                           (tl V702)
                                           V789)
                                          (if
                                           (= () V703)
                                           (do
                                            (shen-incinfs)
                                            (shen-th*
                                             X
                                             A
                                             V788
                                             V789
                                             (freeze
                                              (shen-th*
                                               Y
                                               B
                                               V788
                                               V789
                                               V790))))
                                           (if
                                            (shen-pvar? V703)
                                            (do
                                             (shen-bindv V703 () V789)
                                             (let
                                              Result
                                              (do
                                               (shen-incinfs)
                                               (shen-th*
                                                X
                                                A
                                                V788
                                                V789
                                                (freeze
                                                 (shen-th*
                                                  Y
                                                  B
                                                  V788
                                                  V789
                                                  V790))))
                                              (do
                                               (shen-unbindv V703 V789)
                                               Result)))
                                            false))))
                                        (if
                                         (shen-pvar? V702)
                                         (let
                                          B
                                          (shen-newpv V789)
                                          (do
                                           (shen-bindv
                                            V702
                                            (cons B ())
                                            V789)
                                           (let
                                            Result
                                            (do
                                             (shen-incinfs)
                                             (shen-th*
                                              X
                                              A
                                              V788
                                              V789
                                              (freeze
                                               (shen-th*
                                                Y
                                                B
                                                V788
                                                V789
                                                V790))))
                                            (do
                                             (shen-unbindv V702 V789)
                                             Result))))
                                         false)))
                                      (do
                                       (shen-unbindv V699 V789)
                                       Result)))
                                    false)))
                                 (if
                                  (shen-pvar? V698)
                                  (let
                                   B
                                   (shen-newpv V789)
                                   (do
                                    (shen-bindv
                                     V698
                                     (cons '* (cons B ()))
                                     V789)
                                    (let
                                     Result
                                     (do
                                      (shen-incinfs)
                                      (shen-th*
                                       X
                                       A
                                       V788
                                       V789
                                       (freeze
                                        (shen-th*
                                         Y
                                         B
                                         V788
                                         V789
                                         V790))))
                                     (do
                                      (shen-unbindv V698 V789)
                                      Result))))
                                  false))))
                              (if
                               (shen-pvar? V697)
                               (let
                                A
                                (shen-newpv V789)
                                (let
                                 B
                                 (shen-newpv V789)
                                 (do
                                  (shen-bindv
                                   V697
                                   (cons A (cons '* (cons B ())))
                                   V789)
                                  (let
                                   Result
                                   (do
                                    (shen-incinfs)
                                    (shen-th*
                                     X
                                     A
                                     V788
                                     V789
                                     (freeze
                                      (shen-th* Y B V788 V789 V790))))
                                   (do
                                    (shen-unbindv V697 V789)
                                    Result)))))
                               false)))
                            false)))
                         false)))
                      false))
                    false))
                  false))
                (if
                 (= Case false)
                 (let
                  Case
                  (let
                   V704
                   (shen-lazyderef V786 V789)
                   (if
                    (cons? V704)
                    (let
                     V705
                     (shen-lazyderef (hd V704) V789)
                     (if
                      (= '__at__v V705)
                      (let
                       V706
                       (shen-lazyderef (tl V704) V789)
                       (if
                        (cons? V706)
                        (let
                         X
                         (hd V706)
                         (let
                          V707
                          (shen-lazyderef (tl V706) V789)
                          (if
                           (cons? V707)
                           (let
                            Y
                            (hd V707)
                            (let
                             V708
                             (shen-lazyderef (tl V707) V789)
                             (if
                              (= () V708)
                              (let
                               V709
                               (shen-lazyderef V787 V789)
                               (if
                                (cons? V709)
                                (let
                                 V710
                                 (shen-lazyderef (hd V709) V789)
                                 (if
                                  (= 'vector V710)
                                  (let
                                   V711
                                   (shen-lazyderef (tl V709) V789)
                                   (if
                                    (cons? V711)
                                    (let
                                     A
                                     (hd V711)
                                     (let
                                      V712
                                      (shen-lazyderef (tl V711) V789)
                                      (if
                                       (= () V712)
                                       (do
                                        (shen-incinfs)
                                        (shen-th*
                                         X
                                         A
                                         V788
                                         V789
                                         (freeze
                                          (shen-th*
                                           Y
                                           (cons 'vector (cons A ()))
                                           V788
                                           V789
                                           V790))))
                                       (if
                                        (shen-pvar? V712)
                                        (do
                                         (shen-bindv V712 () V789)
                                         (let
                                          Result
                                          (do
                                           (shen-incinfs)
                                           (shen-th*
                                            X
                                            A
                                            V788
                                            V789
                                            (freeze
                                             (shen-th*
                                              Y
                                              (cons
                                               'vector
                                               (cons A ()))
                                              V788
                                              V789
                                              V790))))
                                          (do
                                           (shen-unbindv V712 V789)
                                           Result)))
                                        false))))
                                    (if
                                     (shen-pvar? V711)
                                     (let
                                      A
                                      (shen-newpv V789)
                                      (do
                                       (shen-bindv
                                        V711
                                        (cons A ())
                                        V789)
                                       (let
                                        Result
                                        (do
                                         (shen-incinfs)
                                         (shen-th*
                                          X
                                          A
                                          V788
                                          V789
                                          (freeze
                                           (shen-th*
                                            Y
                                            (cons 'vector (cons A ()))
                                            V788
                                            V789
                                            V790))))
                                        (do
                                         (shen-unbindv V711 V789)
                                         Result))))
                                     false)))
                                  (if
                                   (shen-pvar? V710)
                                   (do
                                    (shen-bindv V710 'vector V789)
                                    (let
                                     Result
                                     (let
                                      V713
                                      (shen-lazyderef (tl V709) V789)
                                      (if
                                       (cons? V713)
                                       (let
                                        A
                                        (hd V713)
                                        (let
                                         V714
                                         (shen-lazyderef
                                          (tl V713)
                                          V789)
                                         (if
                                          (= () V714)
                                          (do
                                           (shen-incinfs)
                                           (shen-th*
                                            X
                                            A
                                            V788
                                            V789
                                            (freeze
                                             (shen-th*
                                              Y
                                              (cons
                                               'vector
                                               (cons A ()))
                                              V788
                                              V789
                                              V790))))
                                          (if
                                           (shen-pvar? V714)
                                           (do
                                            (shen-bindv V714 () V789)
                                            (let
                                             Result
                                             (do
                                              (shen-incinfs)
                                              (shen-th*
                                               X
                                               A
                                               V788
                                               V789
                                               (freeze
                                                (shen-th*
                                                 Y
                                                 (cons
                                                  'vector
                                                  (cons A ()))
                                                 V788
                                                 V789
                                                 V790))))
                                             (do
                                              (shen-unbindv V714 V789)
                                              Result)))
                                           false))))
                                       (if
                                        (shen-pvar? V713)
                                        (let
                                         A
                                         (shen-newpv V789)
                                         (do
                                          (shen-bindv
                                           V713
                                           (cons A ())
                                           V789)
                                          (let
                                           Result
                                           (do
                                            (shen-incinfs)
                                            (shen-th*
                                             X
                                             A
                                             V788
                                             V789
                                             (freeze
                                              (shen-th*
                                               Y
                                               (cons
                                                'vector
                                                (cons A ()))
                                               V788
                                               V789
                                               V790))))
                                           (do
                                            (shen-unbindv V713 V789)
                                            Result))))
                                        false)))
                                     (do
                                      (shen-unbindv V710 V789)
                                      Result)))
                                   false)))
                                (if
                                 (shen-pvar? V709)
                                 (let
                                  A
                                  (shen-newpv V789)
                                  (do
                                   (shen-bindv
                                    V709
                                    (cons 'vector (cons A ()))
                                    V789)
                                   (let
                                    Result
                                    (do
                                     (shen-incinfs)
                                     (shen-th*
                                      X
                                      A
                                      V788
                                      V789
                                      (freeze
                                       (shen-th*
                                        Y
                                        (cons 'vector (cons A ()))
                                        V788
                                        V789
                                        V790))))
                                    (do
                                     (shen-unbindv V709 V789)
                                     Result))))
                                 false)))
                              false)))
                           false)))
                        false))
                      false))
                    false))
                  (if
                   (= Case false)
                   (let
                    Case
                    (let
                     V715
                     (shen-lazyderef V786 V789)
                     (if
                      (cons? V715)
                      (let
                       V716
                       (shen-lazyderef (hd V715) V789)
                       (if
                        (= '__at__s V716)
                        (let
                         V717
                         (shen-lazyderef (tl V715) V789)
                         (if
                          (cons? V717)
                          (let
                           X
                           (hd V717)
                           (let
                            V718
                            (shen-lazyderef (tl V717) V789)
                            (if
                             (cons? V718)
                             (let
                              Y
                              (hd V718)
                              (let
                               V719
                               (shen-lazyderef (tl V718) V789)
                               (if
                                (= () V719)
                                (let
                                 V720
                                 (shen-lazyderef V787 V789)
                                 (if
                                  (= 'string V720)
                                  (do
                                   (shen-incinfs)
                                   (shen-th*
                                    X
                                    'string
                                    V788
                                    V789
                                    (freeze
                                     (shen-th*
                                      Y
                                      'string
                                      V788
                                      V789
                                      V790))))
                                  (if
                                   (shen-pvar? V720)
                                   (do
                                    (shen-bindv V720 'string V789)
                                    (let
                                     Result
                                     (do
                                      (shen-incinfs)
                                      (shen-th*
                                       X
                                       'string
                                       V788
                                       V789
                                       (freeze
                                        (shen-th*
                                         Y
                                         'string
                                         V788
                                         V789
                                         V790))))
                                     (do
                                      (shen-unbindv V720 V789)
                                      Result)))
                                   false)))
                                false)))
                             false)))
                          false))
                        false))
                      false))
                    (if
                     (= Case false)
                     (let
                      Case
                      (let
                       V721
                       (shen-lazyderef V786 V789)
                       (if
                        (cons? V721)
                        (let
                         V722
                         (shen-lazyderef (hd V721) V789)
                         (if
                          (= 'lambda V722)
                          (let
                           V723
                           (shen-lazyderef (tl V721) V789)
                           (if
                            (cons? V723)
                            (let
                             X
                             (hd V723)
                             (let
                              V724
                              (shen-lazyderef (tl V723) V789)
                              (if
                               (cons? V724)
                               (let
                                Y
                                (hd V724)
                                (let
                                 V725
                                 (shen-lazyderef (tl V724) V789)
                                 (if
                                  (= () V725)
                                  (let
                                   V726
                                   (shen-lazyderef V787 V789)
                                   (if
                                    (cons? V726)
                                    (let
                                     A
                                     (hd V726)
                                     (let
                                      V727
                                      (shen-lazyderef (tl V726) V789)
                                      (if
                                       (cons? V727)
                                       (let
                                        V728
                                        (shen-lazyderef (hd V727) V789)
                                        (if
                                         (= '--> V728)
                                         (let
                                          V729
                                          (shen-lazyderef
                                           (tl V727)
                                           V789)
                                          (if
                                           (cons? V729)
                                           (let
                                            B
                                            (hd V729)
                                            (let
                                             V730
                                             (shen-lazyderef
                                              (tl V729)
                                              V789)
                                             (if
                                              (= () V730)
                                              (let
                                               Z
                                               (shen-newpv V789)
                                               (let
                                                X&&
                                                (shen-newpv V789)
                                                (do
                                                 (shen-incinfs)
                                                 (cut
                                                  Throwcontrol
                                                  V789
                                                  (freeze
                                                   (bind
                                                    X&&
                                                    (shen-placeholder)
                                                    V789
                                                    (freeze
                                                     (bind
                                                      Z
                                                      (shen-ebr
                                                       (shen-lazyderef
                                                        X&&
                                                        V789)
                                                       (shen-lazyderef
                                                        X
                                                        V789)
                                                       (shen-lazyderef
                                                        Y
                                                        V789))
                                                      V789
                                                      (freeze
                                                       (shen-th*
                                                        Z
                                                        B
                                                        (cons
                                                         (cons
                                                          X&&
                                                          (cons
                                                           (intern ":")
                                                           (cons
                                                            A
                                                            ())))
                                                         V788)
                                                        V789
                                                        V790))))))))))
                                              (if
                                               (shen-pvar? V730)
                                               (do
                                                (shen-bindv
                                                 V730
                                                 ()
                                                 V789)
                                                (let
                                                 Result
                                                 (let
                                                  Z
                                                  (shen-newpv V789)
                                                  (let
                                                   X&&
                                                   (shen-newpv V789)
                                                   (do
                                                    (shen-incinfs)
                                                    (cut
                                                     Throwcontrol
                                                     V789
                                                     (freeze
                                                      (bind
                                                       X&&
                                                       (shen-placeholder)
                                                       V789
                                                       (freeze
                                                        (bind
                                                         Z
                                                         (shen-ebr
                                                          (shen-lazyderef
                                                           X&&
                                                           V789)
                                                          (shen-lazyderef
                                                           X
                                                           V789)
                                                          (shen-lazyderef
                                                           Y
                                                           V789))
                                                         V789
                                                         (freeze
                                                          (shen-th*
                                                           Z
                                                           B
                                                           (cons
                                                            (cons
                                                             X&&
                                                             (cons
                                                              (intern
                                                               ":")
                                                              (cons
                                                               A
                                                               ())))
                                                            V788)
                                                           V789
                                                           V790))))))))))
                                                 (do
                                                  (shen-unbindv
                                                   V730
                                                   V789)
                                                  Result)))
                                               false))))
                                           (if
                                            (shen-pvar? V729)
                                            (let
                                             B
                                             (shen-newpv V789)
                                             (do
                                              (shen-bindv
                                               V729
                                               (cons B ())
                                               V789)
                                              (let
                                               Result
                                               (let
                                                Z
                                                (shen-newpv V789)
                                                (let
                                                 X&&
                                                 (shen-newpv V789)
                                                 (do
                                                  (shen-incinfs)
                                                  (cut
                                                   Throwcontrol
                                                   V789
                                                   (freeze
                                                    (bind
                                                     X&&
                                                     (shen-placeholder)
                                                     V789
                                                     (freeze
                                                      (bind
                                                       Z
                                                       (shen-ebr
                                                        (shen-lazyderef
                                                         X&&
                                                         V789)
                                                        (shen-lazyderef
                                                         X
                                                         V789)
                                                        (shen-lazyderef
                                                         Y
                                                         V789))
                                                       V789
                                                       (freeze
                                                        (shen-th*
                                                         Z
                                                         B
                                                         (cons
                                                          (cons
                                                           X&&
                                                           (cons
                                                            (intern
                                                             ":")
                                                            (cons
                                                             A
                                                             ())))
                                                          V788)
                                                         V789
                                                         V790))))))))))
                                               (do
                                                (shen-unbindv
                                                 V729
                                                 V789)
                                                Result))))
                                            false)))
                                         (if
                                          (shen-pvar? V728)
                                          (do
                                           (shen-bindv V728 '--> V789)
                                           (let
                                            Result
                                            (let
                                             V731
                                             (shen-lazyderef
                                              (tl V727)
                                              V789)
                                             (if
                                              (cons? V731)
                                              (let
                                               B
                                               (hd V731)
                                               (let
                                                V732
                                                (shen-lazyderef
                                                 (tl V731)
                                                 V789)
                                                (if
                                                 (= () V732)
                                                 (let
                                                  Z
                                                  (shen-newpv V789)
                                                  (let
                                                   X&&
                                                   (shen-newpv V789)
                                                   (do
                                                    (shen-incinfs)
                                                    (cut
                                                     Throwcontrol
                                                     V789
                                                     (freeze
                                                      (bind
                                                       X&&
                                                       (shen-placeholder)
                                                       V789
                                                       (freeze
                                                        (bind
                                                         Z
                                                         (shen-ebr
                                                          (shen-lazyderef
                                                           X&&
                                                           V789)
                                                          (shen-lazyderef
                                                           X
                                                           V789)
                                                          (shen-lazyderef
                                                           Y
                                                           V789))
                                                         V789
                                                         (freeze
                                                          (shen-th*
                                                           Z
                                                           B
                                                           (cons
                                                            (cons
                                                             X&&
                                                             (cons
                                                              (intern
                                                               ":")
                                                              (cons
                                                               A
                                                               ())))
                                                            V788)
                                                           V789
                                                           V790))))))))))
                                                 (if
                                                  (shen-pvar? V732)
                                                  (do
                                                   (shen-bindv
                                                    V732
                                                    ()
                                                    V789)
                                                   (let
                                                    Result
                                                    (let
                                                     Z
                                                     (shen-newpv V789)
                                                     (let
                                                      X&&
                                                      (shen-newpv V789)
                                                      (do
                                                       (shen-incinfs)
                                                       (cut
                                                        Throwcontrol
                                                        V789
                                                        (freeze
                                                         (bind
                                                          X&&
                                                          (shen-placeholder)
                                                          V789
                                                          (freeze
                                                           (bind
                                                            Z
                                                            (shen-ebr
                                                             (shen-lazyderef
                                                              X&&
                                                              V789)
                                                             (shen-lazyderef
                                                              X
                                                              V789)
                                                             (shen-lazyderef
                                                              Y
                                                              V789))
                                                            V789
                                                            (freeze
                                                             (shen-th*
                                                              Z
                                                              B
                                                              (cons
                                                               (cons
                                                                X&&
                                                                (cons
                                                                 (intern
                                                                  ":")
                                                                 (cons
                                                                  A
                                                                  ())))
                                                               V788)
                                                              V789
                                                              V790))))))))))
                                                    (do
                                                     (shen-unbindv
                                                      V732
                                                      V789)
                                                     Result)))
                                                  false))))
                                              (if
                                               (shen-pvar? V731)
                                               (let
                                                B
                                                (shen-newpv V789)
                                                (do
                                                 (shen-bindv
                                                  V731
                                                  (cons B ())
                                                  V789)
                                                 (let
                                                  Result
                                                  (let
                                                   Z
                                                   (shen-newpv V789)
                                                   (let
                                                    X&&
                                                    (shen-newpv V789)
                                                    (do
                                                     (shen-incinfs)
                                                     (cut
                                                      Throwcontrol
                                                      V789
                                                      (freeze
                                                       (bind
                                                        X&&
                                                        (shen-placeholder)
                                                        V789
                                                        (freeze
                                                         (bind
                                                          Z
                                                          (shen-ebr
                                                           (shen-lazyderef
                                                            X&&
                                                            V789)
                                                           (shen-lazyderef
                                                            X
                                                            V789)
                                                           (shen-lazyderef
                                                            Y
                                                            V789))
                                                          V789
                                                          (freeze
                                                           (shen-th*
                                                            Z
                                                            B
                                                            (cons
                                                             (cons
                                                              X&&
                                                              (cons
                                                               (intern
                                                                ":")
                                                               (cons
                                                                A
                                                                ())))
                                                             V788)
                                                            V789
                                                            V790))))))))))
                                                  (do
                                                   (shen-unbindv
                                                    V731
                                                    V789)
                                                   Result))))
                                               false)))
                                            (do
                                             (shen-unbindv V728 V789)
                                             Result)))
                                          false)))
                                       (if
                                        (shen-pvar? V727)
                                        (let
                                         B
                                         (shen-newpv V789)
                                         (do
                                          (shen-bindv
                                           V727
                                           (cons '--> (cons B ()))
                                           V789)
                                          (let
                                           Result
                                           (let
                                            Z
                                            (shen-newpv V789)
                                            (let
                                             X&&
                                             (shen-newpv V789)
                                             (do
                                              (shen-incinfs)
                                              (cut
                                               Throwcontrol
                                               V789
                                               (freeze
                                                (bind
                                                 X&&
                                                 (shen-placeholder)
                                                 V789
                                                 (freeze
                                                  (bind
                                                   Z
                                                   (shen-ebr
                                                    (shen-lazyderef
                                                     X&&
                                                     V789)
                                                    (shen-lazyderef
                                                     X
                                                     V789)
                                                    (shen-lazyderef
                                                     Y
                                                     V789))
                                                   V789
                                                   (freeze
                                                    (shen-th*
                                                     Z
                                                     B
                                                     (cons
                                                      (cons
                                                       X&&
                                                       (cons
                                                        (intern ":")
                                                        (cons A ())))
                                                      V788)
                                                     V789
                                                     V790))))))))))
                                           (do
                                            (shen-unbindv V727 V789)
                                            Result))))
                                        false))))
                                    (if
                                     (shen-pvar? V726)
                                     (let
                                      A
                                      (shen-newpv V789)
                                      (let
                                       B
                                       (shen-newpv V789)
                                       (do
                                        (shen-bindv
                                         V726
                                         (cons
                                          A
                                          (cons '--> (cons B ())))
                                         V789)
                                        (let
                                         Result
                                         (let
                                          Z
                                          (shen-newpv V789)
                                          (let
                                           X&&
                                           (shen-newpv V789)
                                           (do
                                            (shen-incinfs)
                                            (cut
                                             Throwcontrol
                                             V789
                                             (freeze
                                              (bind
                                               X&&
                                               (shen-placeholder)
                                               V789
                                               (freeze
                                                (bind
                                                 Z
                                                 (shen-ebr
                                                  (shen-lazyderef
                                                   X&&
                                                   V789)
                                                  (shen-lazyderef
                                                   X
                                                   V789)
                                                  (shen-lazyderef
                                                   Y
                                                   V789))
                                                 V789
                                                 (freeze
                                                  (shen-th*
                                                   Z
                                                   B
                                                   (cons
                                                    (cons
                                                     X&&
                                                     (cons
                                                      (intern ":")
                                                      (cons A ())))
                                                    V788)
                                                   V789
                                                   V790))))))))))
                                         (do
                                          (shen-unbindv V726 V789)
                                          Result)))))
                                     false)))
                                  false)))
                               false)))
                            false))
                          false))
                        false))
                      (if
                       (= Case false)
                       (let
                        Case
                        (let
                         V733
                         (shen-lazyderef V786 V789)
                         (if
                          (cons? V733)
                          (let
                           V734
                           (shen-lazyderef (hd V733) V789)
                           (if
                            (= 'let V734)
                            (let
                             V735
                             (shen-lazyderef (tl V733) V789)
                             (if
                              (cons? V735)
                              (let
                               X
                               (hd V735)
                               (let
                                V736
                                (shen-lazyderef (tl V735) V789)
                                (if
                                 (cons? V736)
                                 (let
                                  Y
                                  (hd V736)
                                  (let
                                   V737
                                   (shen-lazyderef (tl V736) V789)
                                   (if
                                    (cons? V737)
                                    (let
                                     Z
                                     (hd V737)
                                     (let
                                      V738
                                      (shen-lazyderef (tl V737) V789)
                                      (if
                                       (= () V738)
                                       (let
                                        W
                                        (shen-newpv V789)
                                        (let
                                         X&&
                                         (shen-newpv V789)
                                         (let
                                          B
                                          (shen-newpv V789)
                                          (do
                                           (shen-incinfs)
                                           (cut
                                            Throwcontrol
                                            V789
                                            (freeze
                                             (shen-th*
                                              Y
                                              B
                                              V788
                                              V789
                                              (freeze
                                               (bind
                                                X&&
                                                (shen-placeholder)
                                                V789
                                                (freeze
                                                 (bind
                                                  W
                                                  (shen-ebr
                                                   (shen-lazyderef
                                                    X&&
                                                    V789)
                                                   (shen-lazyderef
                                                    X
                                                    V789)
                                                   (shen-lazyderef
                                                    Z
                                                    V789))
                                                  V789
                                                  (freeze
                                                   (shen-th*
                                                    W
                                                    V787
                                                    (cons
                                                     (cons
                                                      X&&
                                                      (cons
                                                       (intern ":")
                                                       (cons B ())))
                                                     V788)
                                                    V789
                                                    V790)))))))))))))
                                       false)))
                                    false)))
                                 false)))
                              false))
                            false))
                          false))
                        (if
                         (= Case false)
                         (let
                          Case
                          (let
                           V739
                           (shen-lazyderef V786 V789)
                           (if
                            (cons? V739)
                            (let
                             V740
                             (shen-lazyderef (hd V739) V789)
                             (if
                              (= 'open V740)
                              (let
                               V741
                               (shen-lazyderef (tl V739) V789)
                               (if
                                (cons? V741)
                                (let
                                 V742
                                 (shen-lazyderef (hd V741) V789)
                                 (if
                                  (= 'file V742)
                                  (let
                                   V743
                                   (shen-lazyderef (tl V741) V789)
                                   (if
                                    (cons? V743)
                                    (let
                                     FileName
                                     (hd V743)
                                     (let
                                      V744
                                      (shen-lazyderef (tl V743) V789)
                                      (if
                                       (cons? V744)
                                       (let
                                        Direction674
                                        (hd V744)
                                        (let
                                         V745
                                         (shen-lazyderef
                                          (tl V744)
                                          V789)
                                         (if
                                          (= () V745)
                                          (let
                                           V746
                                           (shen-lazyderef V787 V789)
                                           (if
                                            (cons? V746)
                                            (let
                                             V747
                                             (shen-lazyderef
                                              (hd V746)
                                              V789)
                                             (if
                                              (= 'stream V747)
                                              (let
                                               V748
                                               (shen-lazyderef
                                                (tl V746)
                                                V789)
                                               (if
                                                (cons? V748)
                                                (let
                                                 Direction
                                                 (hd V748)
                                                 (let
                                                  V749
                                                  (shen-lazyderef
                                                   (tl V748)
                                                   V789)
                                                  (if
                                                   (= () V749)
                                                   (do
                                                    (shen-incinfs)
                                                    (unify!
                                                     Direction
                                                     Direction674
                                                     V789
                                                     (freeze
                                                      (cut
                                                       Throwcontrol
                                                       V789
                                                       (freeze
                                                        (shen-th*
                                                         FileName
                                                         'string
                                                         V788
                                                         V789
                                                         V790))))))
                                                   (if
                                                    (shen-pvar? V749)
                                                    (do
                                                     (shen-bindv
                                                      V749
                                                      ()
                                                      V789)
                                                     (let
                                                      Result
                                                      (do
                                                       (shen-incinfs)
                                                       (unify!
                                                        Direction
                                                        Direction674
                                                        V789
                                                        (freeze
                                                         (cut
                                                          Throwcontrol
                                                          V789
                                                          (freeze
                                                           (shen-th*
                                                            FileName
                                                            'string
                                                            V788
                                                            V789
                                                            V790))))))
                                                      (do
                                                       (shen-unbindv
                                                        V749
                                                        V789)
                                                       Result)))
                                                    false))))
                                                (if
                                                 (shen-pvar? V748)
                                                 (let
                                                  Direction
                                                  (shen-newpv V789)
                                                  (do
                                                   (shen-bindv
                                                    V748
                                                    (cons Direction ())
                                                    V789)
                                                   (let
                                                    Result
                                                    (do
                                                     (shen-incinfs)
                                                     (unify!
                                                      Direction
                                                      Direction674
                                                      V789
                                                      (freeze
                                                       (cut
                                                        Throwcontrol
                                                        V789
                                                        (freeze
                                                         (shen-th*
                                                          FileName
                                                          'string
                                                          V788
                                                          V789
                                                          V790))))))
                                                    (do
                                                     (shen-unbindv
                                                      V748
                                                      V789)
                                                     Result))))
                                                 false)))
                                              (if
                                               (shen-pvar? V747)
                                               (do
                                                (shen-bindv
                                                 V747
                                                 'stream
                                                 V789)
                                                (let
                                                 Result
                                                 (let
                                                  V750
                                                  (shen-lazyderef
                                                   (tl V746)
                                                   V789)
                                                  (if
                                                   (cons? V750)
                                                   (let
                                                    Direction
                                                    (hd V750)
                                                    (let
                                                     V751
                                                     (shen-lazyderef
                                                      (tl V750)
                                                      V789)
                                                     (if
                                                      (= () V751)
                                                      (do
                                                       (shen-incinfs)
                                                       (unify!
                                                        Direction
                                                        Direction674
                                                        V789
                                                        (freeze
                                                         (cut
                                                          Throwcontrol
                                                          V789
                                                          (freeze
                                                           (shen-th*
                                                            FileName
                                                            'string
                                                            V788
                                                            V789
                                                            V790))))))
                                                      (if
                                                       (shen-pvar?
                                                        V751)
                                                       (do
                                                        (shen-bindv
                                                         V751
                                                         ()
                                                         V789)
                                                        (let
                                                         Result
                                                         (do
                                                          (shen-incinfs)
                                                          (unify!
                                                           Direction
                                                           Direction674
                                                           V789
                                                           (freeze
                                                            (cut
                                                             Throwcontrol
                                                             V789
                                                             (freeze
                                                              (shen-th*
                                                               FileName
                                                               'string
                                                               V788
                                                               V789
                                                               V790))))))
                                                         (do
                                                          (shen-unbindv
                                                           V751
                                                           V789)
                                                          Result)))
                                                       false))))
                                                   (if
                                                    (shen-pvar? V750)
                                                    (let
                                                     Direction
                                                     (shen-newpv V789)
                                                     (do
                                                      (shen-bindv
                                                       V750
                                                       (cons
                                                        Direction
                                                        ())
                                                       V789)
                                                      (let
                                                       Result
                                                       (do
                                                        (shen-incinfs)
                                                        (unify!
                                                         Direction
                                                         Direction674
                                                         V789
                                                         (freeze
                                                          (cut
                                                           Throwcontrol
                                                           V789
                                                           (freeze
                                                            (shen-th*
                                                             FileName
                                                             'string
                                                             V788
                                                             V789
                                                             V790))))))
                                                       (do
                                                        (shen-unbindv
                                                         V750
                                                         V789)
                                                        Result))))
                                                    false)))
                                                 (do
                                                  (shen-unbindv
                                                   V747
                                                   V789)
                                                  Result)))
                                               false)))
                                            (if
                                             (shen-pvar? V746)
                                             (let
                                              Direction
                                              (shen-newpv V789)
                                              (do
                                               (shen-bindv
                                                V746
                                                (cons
                                                 'stream
                                                 (cons Direction ()))
                                                V789)
                                               (let
                                                Result
                                                (do
                                                 (shen-incinfs)
                                                 (unify!
                                                  Direction
                                                  Direction674
                                                  V789
                                                  (freeze
                                                   (cut
                                                    Throwcontrol
                                                    V789
                                                    (freeze
                                                     (shen-th*
                                                      FileName
                                                      'string
                                                      V788
                                                      V789
                                                      V790))))))
                                                (do
                                                 (shen-unbindv
                                                  V746
                                                  V789)
                                                 Result))))
                                             false)))
                                          false)))
                                       false)))
                                    false))
                                  false))
                                false))
                              false))
                            false))
                          (if
                           (= Case false)
                           (let
                            Case
                            (let
                             V752
                             (shen-lazyderef V786 V789)
                             (if
                              (cons? V752)
                              (let
                               V753
                               (shen-lazyderef (hd V752) V789)
                               (if
                                (= 'type V753)
                                (let
                                 V754
                                 (shen-lazyderef (tl V752) V789)
                                 (if
                                  (cons? V754)
                                  (let
                                   X
                                   (hd V754)
                                   (let
                                    V755
                                    (shen-lazyderef (tl V754) V789)
                                    (if
                                     (cons? V755)
                                     (let
                                      A
                                      (hd V755)
                                      (let
                                       V756
                                       (shen-lazyderef (tl V755) V789)
                                       (if
                                        (= () V756)
                                        (do
                                         (shen-incinfs)
                                         (cut
                                          Throwcontrol
                                          V789
                                          (freeze
                                           (unify
                                            A
                                            V787
                                            V789
                                            (freeze
                                             (shen-th*
                                              X
                                              A
                                              V788
                                              V789
                                              V790))))))
                                        false)))
                                     false)))
                                  false))
                                false))
                              false))
                            (if
                             (= Case false)
                             (let
                              Case
                              (let
                               V757
                               (shen-lazyderef V786 V789)
                               (if
                                (cons? V757)
                                (let
                                 V758
                                 (shen-lazyderef (hd V757) V789)
                                 (if
                                  (= 'input+ V758)
                                  (let
                                   V759
                                   (shen-lazyderef (tl V757) V789)
                                   (if
                                    (cons? V759)
                                    (let
                                     V760
                                     (shen-lazyderef (hd V759) V789)
                                     (if
                                      (= (intern ":") V760)
                                      (let
                                       V761
                                       (shen-lazyderef (tl V759) V789)
                                       (if
                                        (cons? V761)
                                        (let
                                         A
                                         (hd V761)
                                         (let
                                          V762
                                          (shen-lazyderef
                                           (tl V761)
                                           V789)
                                          (if
                                           (= () V762)
                                           (let
                                            C
                                            (shen-newpv V789)
                                            (do
                                             (shen-incinfs)
                                             (bind
                                              C
                                              (shen-normalise-type
                                               (shen-lazyderef A V789))
                                              V789
                                              (freeze
                                               (unify
                                                V787
                                                C
                                                V789
                                                V790)))))
                                           false)))
                                        false))
                                      false))
                                    false))
                                  false))
                                false))
                              (if
                               (= Case false)
                               (let
                                Case
                                (let
                                 V763
                                 (shen-lazyderef V786 V789)
                                 (if
                                  (cons? V763)
                                  (let
                                   V764
                                   (shen-lazyderef (hd V763) V789)
                                   (if
                                    (= 'where V764)
                                    (let
                                     V765
                                     (shen-lazyderef (tl V763) V789)
                                     (if
                                      (cons? V765)
                                      (let
                                       P
                                       (hd V765)
                                       (let
                                        V766
                                        (shen-lazyderef (tl V765) V789)
                                        (if
                                         (cons? V766)
                                         (let
                                          X
                                          (hd V766)
                                          (let
                                           V767
                                           (shen-lazyderef
                                            (tl V766)
                                            V789)
                                           (if
                                            (= () V767)
                                            (do
                                             (shen-incinfs)
                                             (cut
                                              Throwcontrol
                                              V789
                                              (freeze
                                               (shen-th*
                                                P
                                                'boolean
                                                V788
                                                V789
                                                (freeze
                                                 (cut
                                                  Throwcontrol
                                                  V789
                                                  (freeze
                                                   (shen-th*
                                                    X
                                                    V787
                                                    (cons
                                                     (cons
                                                      P
                                                      (cons
                                                       (intern ":")
                                                       (cons
                                                        'verified
                                                        ())))
                                                     V788)
                                                    V789
                                                    V790))))))))
                                            false)))
                                         false)))
                                      false))
                                    false))
                                  false))
                                (if
                                 (= Case false)
                                 (let
                                  Case
                                  (let
                                   V768
                                   (shen-lazyderef V786 V789)
                                   (if
                                    (cons? V768)
                                    (let
                                     V769
                                     (shen-lazyderef (hd V768) V789)
                                     (if
                                      (= 'set V769)
                                      (let
                                       V770
                                       (shen-lazyderef (tl V768) V789)
                                       (if
                                        (cons? V770)
                                        (let
                                         Var
                                         (hd V770)
                                         (let
                                          V771
                                          (shen-lazyderef
                                           (tl V770)
                                           V789)
                                          (if
                                           (cons? V771)
                                           (let
                                            Val
                                            (hd V771)
                                            (let
                                             V772
                                             (shen-lazyderef
                                              (tl V771)
                                              V789)
                                             (if
                                              (= () V772)
                                              (do
                                               (shen-incinfs)
                                               (cut
                                                Throwcontrol
                                                V789
                                                (freeze
                                                 (shen-th*
                                                  (cons
                                                   'value
                                                   (cons Var ()))
                                                  V787
                                                  V788
                                                  V789
                                                  (freeze
                                                   (shen-th*
                                                    Val
                                                    V787
                                                    V788
                                                    V789
                                                    V790))))))
                                              false)))
                                           false)))
                                        false))
                                      false))
                                    false))
                                  (if
                                   (= Case false)
                                   (let
                                    Case
                                    (let
                                     V773
                                     (shen-lazyderef V786 V789)
                                     (if
                                      (cons? V773)
                                      (let
                                       V774
                                       (shen-lazyderef (hd V773) V789)
                                       (if
                                        (= 'fail V774)
                                        (let
                                         V775
                                         (shen-lazyderef
                                          (tl V773)
                                          V789)
                                         (if
                                          (= () V775)
                                          (let
                                           V776
                                           (shen-lazyderef V787 V789)
                                           (if
                                            (= 'symbol V776)
                                            (do
                                             (shen-incinfs)
                                             (thaw V790))
                                            (if
                                             (shen-pvar? V776)
                                             (do
                                              (shen-bindv
                                               V776
                                               'symbol
                                               V789)
                                              (let
                                               Result
                                               (do
                                                (shen-incinfs)
                                                (thaw V790))
                                               (do
                                                (shen-unbindv
                                                 V776
                                                 V789)
                                                Result)))
                                             false)))
                                          false))
                                        false))
                                      false))
                                    (if
                                     (= Case false)
                                     (let
                                      Case
                                      (let
                                       NewHyp
                                       (shen-newpv V789)
                                       (do
                                        (shen-incinfs)
                                        (shen-t*-hyps
                                         V788
                                         NewHyp
                                         V789
                                         (freeze
                                          (shen-th*
                                           V786
                                           V787
                                           NewHyp
                                           V789
                                           V790)))))
                                      (if
                                       (= Case false)
                                       (let
                                        Case
                                        (let
                                         V777
                                         (shen-lazyderef V786 V789)
                                         (if
                                          (cons? V777)
                                          (let
                                           V778
                                           (shen-lazyderef
                                            (hd V777)
                                            V789)
                                           (if
                                            (= 'define V778)
                                            (let
                                             V779
                                             (shen-lazyderef
                                              (tl V777)
                                              V789)
                                             (if
                                              (cons? V779)
                                              (let
                                               F
                                               (hd V779)
                                               (let
                                                X
                                                (tl V779)
                                                (do
                                                 (shen-incinfs)
                                                 (cut
                                                  Throwcontrol
                                                  V789
                                                  (freeze
                                                   (shen-t*-kl_def
                                                    (cons
                                                     'define
                                                     (cons F X))
                                                    V787
                                                    V788
                                                    V789
                                                    V790))))))
                                              false))
                                            false))
                                          false))
                                        (if
                                         (= Case false)
                                         (let
                                          Case
                                          (let
                                           V780
                                           (shen-lazyderef V786 V789)
                                           (if
                                            (cons? V780)
                                            (let
                                             V781
                                             (shen-lazyderef
                                              (hd V780)
                                              V789)
                                             (if
                                              (=
                                               'shen-process-datatype
                                               V781)
                                              (let
                                               V782
                                               (shen-lazyderef
                                                V787
                                                V789)
                                               (if
                                                (= 'symbol V782)
                                                (do
                                                 (shen-incinfs)
                                                 (thaw V790))
                                                (if
                                                 (shen-pvar? V782)
                                                 (do
                                                  (shen-bindv
                                                   V782
                                                   'symbol
                                                   V789)
                                                  (let
                                                   Result
                                                   (do
                                                    (shen-incinfs)
                                                    (thaw V790))
                                                   (do
                                                    (shen-unbindv
                                                     V782
                                                     V789)
                                                    Result)))
                                                 false)))
                                              false))
                                            false))
                                          (if
                                           (= Case false)
                                           (let
                                            Case
                                            (let
                                             V783
                                             (shen-lazyderef V786 V789)
                                             (if
                                              (cons? V783)
                                              (let
                                               V784
                                               (shen-lazyderef
                                                (hd V783)
                                                V789)
                                               (if
                                                (=
                                                 'shen-synonyms-help
                                                 V784)
                                                (let
                                                 V785
                                                 (shen-lazyderef
                                                  V787
                                                  V789)
                                                 (if
                                                  (= 'symbol V785)
                                                  (do
                                                   (shen-incinfs)
                                                   (thaw V790))
                                                  (if
                                                   (shen-pvar? V785)
                                                   (do
                                                    (shen-bindv
                                                     V785
                                                     'symbol
                                                     V789)
                                                    (let
                                                     Result
                                                     (do
                                                      (shen-incinfs)
                                                      (thaw V790))
                                                     (do
                                                      (shen-unbindv
                                                       V785
                                                       V789)
                                                      Result)))
                                                   false)))
                                                false))
                                              false))
                                            (if
                                             (= Case false)
                                             (let
                                              Datatypes
                                              (shen-newpv V789)
                                              (do
                                               (shen-incinfs)
                                               (bind
                                                Datatypes
                                                (value
                                                 'shen-*datatypes*)
                                                V789
                                                (freeze
                                                 (shen-udefs*
                                                  (cons
                                                   V786
                                                   (cons
                                                    (intern ":")
                                                    (cons V787 ())))
                                                  V788
                                                  Datatypes
                                                  V789
                                                  V790)))))
                                             Case))
                                           Case))
                                         Case))
                                       Case))
                                     Case))
                                   Case))
                                 Case))
                               Case))
                             Case))
                           Case))
                         Case))
                       Case))
                     Case))
                   Case))
                 Case))
               Case))
             Case))
           Case))
         Case))
       Case))
     Case)))))

(defun
 shen-t*-hyps
 (V783 V784 V785 V786)
 (let
  Case
  (let
   V549
   (shen-lazyderef V783 V785)
   (if
    (cons? V549)
    (let
     V550
     (shen-lazyderef (hd V549) V785)
     (if
      (cons? V550)
      (let
       V551
       (shen-lazyderef (hd V550) V785)
       (if
        (cons? V551)
        (let
         V552
         (shen-lazyderef (hd V551) V785)
         (if
          (= 'cons V552)
          (let
           V553
           (shen-lazyderef (tl V551) V785)
           (if
            (cons? V553)
            (let
             X
             (hd V553)
             (let
              V554
              (shen-lazyderef (tl V553) V785)
              (if
               (cons? V554)
               (let
                Y
                (hd V554)
                (let
                 V555
                 (shen-lazyderef (tl V554) V785)
                 (if
                  (= () V555)
                  (let
                   V556
                   (shen-lazyderef (tl V550) V785)
                   (if
                    (cons? V556)
                    (let
                     V557
                     (shen-lazyderef (hd V556) V785)
                     (if
                      (= (intern ":") V557)
                      (let
                       V558
                       (shen-lazyderef (tl V556) V785)
                       (if
                        (cons? V558)
                        (let
                         V559
                         (shen-lazyderef (hd V558) V785)
                         (if
                          (cons? V559)
                          (let
                           V560
                           (shen-lazyderef (hd V559) V785)
                           (if
                            (= 'list V560)
                            (let
                             V561
                             (shen-lazyderef (tl V559) V785)
                             (if
                              (cons? V561)
                              (let
                               A
                               (hd V561)
                               (let
                                V562
                                (shen-lazyderef (tl V561) V785)
                                (if
                                 (= () V562)
                                 (let
                                  V563
                                  (shen-lazyderef (tl V558) V785)
                                  (if
                                   (= () V563)
                                   (let
                                    Hyp
                                    (tl V549)
                                    (do
                                     (shen-incinfs)
                                     (bind
                                      V784
                                      (cons
                                       (cons
                                        (shen-lazyderef X V785)
                                        (cons
                                         (intern ":")
                                         (cons
                                          (shen-lazyderef A V785)
                                          ())))
                                       (cons
                                        (cons
                                         (shen-lazyderef Y V785)
                                         (cons
                                          (intern ":")
                                          (cons
                                           (cons
                                            'list
                                            (cons
                                             (shen-lazyderef A V785)
                                             ()))
                                           ())))
                                        (shen-lazyderef Hyp V785)))
                                      V785
                                      V786)))
                                   (if
                                    (shen-pvar? V563)
                                    (do
                                     (shen-bindv V563 () V785)
                                     (let
                                      Result
                                      (let
                                       Hyp
                                       (tl V549)
                                       (do
                                        (shen-incinfs)
                                        (bind
                                         V784
                                         (cons
                                          (cons
                                           (shen-lazyderef X V785)
                                           (cons
                                            (intern ":")
                                            (cons
                                             (shen-lazyderef A V785)
                                             ())))
                                          (cons
                                           (cons
                                            (shen-lazyderef Y V785)
                                            (cons
                                             (intern ":")
                                             (cons
                                              (cons
                                               'list
                                               (cons
                                                (shen-lazyderef A V785)
                                                ()))
                                              ())))
                                           (shen-lazyderef Hyp V785)))
                                         V785
                                         V786)))
                                      (do
                                       (shen-unbindv V563 V785)
                                       Result)))
                                    false)))
                                 (if
                                  (shen-pvar? V562)
                                  (do
                                   (shen-bindv V562 () V785)
                                   (let
                                    Result
                                    (let
                                     V564
                                     (shen-lazyderef (tl V558) V785)
                                     (if
                                      (= () V564)
                                      (let
                                       Hyp
                                       (tl V549)
                                       (do
                                        (shen-incinfs)
                                        (bind
                                         V784
                                         (cons
                                          (cons
                                           (shen-lazyderef X V785)
                                           (cons
                                            (intern ":")
                                            (cons
                                             (shen-lazyderef A V785)
                                             ())))
                                          (cons
                                           (cons
                                            (shen-lazyderef Y V785)
                                            (cons
                                             (intern ":")
                                             (cons
                                              (cons
                                               'list
                                               (cons
                                                (shen-lazyderef A V785)
                                                ()))
                                              ())))
                                           (shen-lazyderef Hyp V785)))
                                         V785
                                         V786)))
                                      (if
                                       (shen-pvar? V564)
                                       (do
                                        (shen-bindv V564 () V785)
                                        (let
                                         Result
                                         (let
                                          Hyp
                                          (tl V549)
                                          (do
                                           (shen-incinfs)
                                           (bind
                                            V784
                                            (cons
                                             (cons
                                              (shen-lazyderef X V785)
                                              (cons
                                               (intern ":")
                                               (cons
                                                (shen-lazyderef A V785)
                                                ())))
                                             (cons
                                              (cons
                                               (shen-lazyderef Y V785)
                                               (cons
                                                (intern ":")
                                                (cons
                                                 (cons
                                                  'list
                                                  (cons
                                                   (shen-lazyderef
                                                    A
                                                    V785)
                                                   ()))
                                                 ())))
                                              (shen-lazyderef
                                               Hyp
                                               V785)))
                                            V785
                                            V786)))
                                         (do
                                          (shen-unbindv V564 V785)
                                          Result)))
                                       false)))
                                    (do
                                     (shen-unbindv V562 V785)
                                     Result)))
                                  false))))
                              (if
                               (shen-pvar? V561)
                               (let
                                A
                                (shen-newpv V785)
                                (do
                                 (shen-bindv V561 (cons A ()) V785)
                                 (let
                                  Result
                                  (let
                                   V565
                                   (shen-lazyderef (tl V558) V785)
                                   (if
                                    (= () V565)
                                    (let
                                     Hyp
                                     (tl V549)
                                     (do
                                      (shen-incinfs)
                                      (bind
                                       V784
                                       (cons
                                        (cons
                                         (shen-lazyderef X V785)
                                         (cons
                                          (intern ":")
                                          (cons
                                           (shen-lazyderef A V785)
                                           ())))
                                        (cons
                                         (cons
                                          (shen-lazyderef Y V785)
                                          (cons
                                           (intern ":")
                                           (cons
                                            (cons
                                             'list
                                             (cons
                                              (shen-lazyderef A V785)
                                              ()))
                                            ())))
                                         (shen-lazyderef Hyp V785)))
                                       V785
                                       V786)))
                                    (if
                                     (shen-pvar? V565)
                                     (do
                                      (shen-bindv V565 () V785)
                                      (let
                                       Result
                                       (let
                                        Hyp
                                        (tl V549)
                                        (do
                                         (shen-incinfs)
                                         (bind
                                          V784
                                          (cons
                                           (cons
                                            (shen-lazyderef X V785)
                                            (cons
                                             (intern ":")
                                             (cons
                                              (shen-lazyderef A V785)
                                              ())))
                                           (cons
                                            (cons
                                             (shen-lazyderef Y V785)
                                             (cons
                                              (intern ":")
                                              (cons
                                               (cons
                                                'list
                                                (cons
                                                 (shen-lazyderef
                                                  A
                                                  V785)
                                                 ()))
                                               ())))
                                            (shen-lazyderef Hyp V785)))
                                          V785
                                          V786)))
                                       (do
                                        (shen-unbindv V565 V785)
                                        Result)))
                                     false)))
                                  (do
                                   (shen-unbindv V561 V785)
                                   Result))))
                               false)))
                            (if
                             (shen-pvar? V560)
                             (do
                              (shen-bindv V560 'list V785)
                              (let
                               Result
                               (let
                                V566
                                (shen-lazyderef (tl V559) V785)
                                (if
                                 (cons? V566)
                                 (let
                                  A
                                  (hd V566)
                                  (let
                                   V567
                                   (shen-lazyderef (tl V566) V785)
                                   (if
                                    (= () V567)
                                    (let
                                     V568
                                     (shen-lazyderef (tl V558) V785)
                                     (if
                                      (= () V568)
                                      (let
                                       Hyp
                                       (tl V549)
                                       (do
                                        (shen-incinfs)
                                        (bind
                                         V784
                                         (cons
                                          (cons
                                           (shen-lazyderef X V785)
                                           (cons
                                            (intern ":")
                                            (cons
                                             (shen-lazyderef A V785)
                                             ())))
                                          (cons
                                           (cons
                                            (shen-lazyderef Y V785)
                                            (cons
                                             (intern ":")
                                             (cons
                                              (cons
                                               'list
                                               (cons
                                                (shen-lazyderef A V785)
                                                ()))
                                              ())))
                                           (shen-lazyderef Hyp V785)))
                                         V785
                                         V786)))
                                      (if
                                       (shen-pvar? V568)
                                       (do
                                        (shen-bindv V568 () V785)
                                        (let
                                         Result
                                         (let
                                          Hyp
                                          (tl V549)
                                          (do
                                           (shen-incinfs)
                                           (bind
                                            V784
                                            (cons
                                             (cons
                                              (shen-lazyderef X V785)
                                              (cons
                                               (intern ":")
                                               (cons
                                                (shen-lazyderef A V785)
                                                ())))
                                             (cons
                                              (cons
                                               (shen-lazyderef Y V785)
                                               (cons
                                                (intern ":")
                                                (cons
                                                 (cons
                                                  'list
                                                  (cons
                                                   (shen-lazyderef
                                                    A
                                                    V785)
                                                   ()))
                                                 ())))
                                              (shen-lazyderef
                                               Hyp
                                               V785)))
                                            V785
                                            V786)))
                                         (do
                                          (shen-unbindv V568 V785)
                                          Result)))
                                       false)))
                                    (if
                                     (shen-pvar? V567)
                                     (do
                                      (shen-bindv V567 () V785)
                                      (let
                                       Result
                                       (let
                                        V569
                                        (shen-lazyderef (tl V558) V785)
                                        (if
                                         (= () V569)
                                         (let
                                          Hyp
                                          (tl V549)
                                          (do
                                           (shen-incinfs)
                                           (bind
                                            V784
                                            (cons
                                             (cons
                                              (shen-lazyderef X V785)
                                              (cons
                                               (intern ":")
                                               (cons
                                                (shen-lazyderef A V785)
                                                ())))
                                             (cons
                                              (cons
                                               (shen-lazyderef Y V785)
                                               (cons
                                                (intern ":")
                                                (cons
                                                 (cons
                                                  'list
                                                  (cons
                                                   (shen-lazyderef
                                                    A
                                                    V785)
                                                   ()))
                                                 ())))
                                              (shen-lazyderef
                                               Hyp
                                               V785)))
                                            V785
                                            V786)))
                                         (if
                                          (shen-pvar? V569)
                                          (do
                                           (shen-bindv V569 () V785)
                                           (let
                                            Result
                                            (let
                                             Hyp
                                             (tl V549)
                                             (do
                                              (shen-incinfs)
                                              (bind
                                               V784
                                               (cons
                                                (cons
                                                 (shen-lazyderef
                                                  X
                                                  V785)
                                                 (cons
                                                  (intern ":")
                                                  (cons
                                                   (shen-lazyderef
                                                    A
                                                    V785)
                                                   ())))
                                                (cons
                                                 (cons
                                                  (shen-lazyderef
                                                   Y
                                                   V785)
                                                  (cons
                                                   (intern ":")
                                                   (cons
                                                    (cons
                                                     'list
                                                     (cons
                                                      (shen-lazyderef
                                                       A
                                                       V785)
                                                      ()))
                                                    ())))
                                                 (shen-lazyderef
                                                  Hyp
                                                  V785)))
                                               V785
                                               V786)))
                                            (do
                                             (shen-unbindv V569 V785)
                                             Result)))
                                          false)))
                                       (do
                                        (shen-unbindv V567 V785)
                                        Result)))
                                     false))))
                                 (if
                                  (shen-pvar? V566)
                                  (let
                                   A
                                   (shen-newpv V785)
                                   (do
                                    (shen-bindv V566 (cons A ()) V785)
                                    (let
                                     Result
                                     (let
                                      V570
                                      (shen-lazyderef (tl V558) V785)
                                      (if
                                       (= () V570)
                                       (let
                                        Hyp
                                        (tl V549)
                                        (do
                                         (shen-incinfs)
                                         (bind
                                          V784
                                          (cons
                                           (cons
                                            (shen-lazyderef X V785)
                                            (cons
                                             (intern ":")
                                             (cons
                                              (shen-lazyderef A V785)
                                              ())))
                                           (cons
                                            (cons
                                             (shen-lazyderef Y V785)
                                             (cons
                                              (intern ":")
                                              (cons
                                               (cons
                                                'list
                                                (cons
                                                 (shen-lazyderef
                                                  A
                                                  V785)
                                                 ()))
                                               ())))
                                            (shen-lazyderef Hyp V785)))
                                          V785
                                          V786)))
                                       (if
                                        (shen-pvar? V570)
                                        (do
                                         (shen-bindv V570 () V785)
                                         (let
                                          Result
                                          (let
                                           Hyp
                                           (tl V549)
                                           (do
                                            (shen-incinfs)
                                            (bind
                                             V784
                                             (cons
                                              (cons
                                               (shen-lazyderef X V785)
                                               (cons
                                                (intern ":")
                                                (cons
                                                 (shen-lazyderef
                                                  A
                                                  V785)
                                                 ())))
                                              (cons
                                               (cons
                                                (shen-lazyderef Y V785)
                                                (cons
                                                 (intern ":")
                                                 (cons
                                                  (cons
                                                   'list
                                                   (cons
                                                    (shen-lazyderef
                                                     A
                                                     V785)
                                                    ()))
                                                  ())))
                                               (shen-lazyderef
                                                Hyp
                                                V785)))
                                             V785
                                             V786)))
                                          (do
                                           (shen-unbindv V570 V785)
                                           Result)))
                                        false)))
                                     (do
                                      (shen-unbindv V566 V785)
                                      Result))))
                                  false)))
                               (do (shen-unbindv V560 V785) Result)))
                             false)))
                          (if
                           (shen-pvar? V559)
                           (let
                            A
                            (shen-newpv V785)
                            (do
                             (shen-bindv
                              V559
                              (cons 'list (cons A ()))
                              V785)
                             (let
                              Result
                              (let
                               V571
                               (shen-lazyderef (tl V558) V785)
                               (if
                                (= () V571)
                                (let
                                 Hyp
                                 (tl V549)
                                 (do
                                  (shen-incinfs)
                                  (bind
                                   V784
                                   (cons
                                    (cons
                                     (shen-lazyderef X V785)
                                     (cons
                                      (intern ":")
                                      (cons
                                       (shen-lazyderef A V785)
                                       ())))
                                    (cons
                                     (cons
                                      (shen-lazyderef Y V785)
                                      (cons
                                       (intern ":")
                                       (cons
                                        (cons
                                         'list
                                         (cons
                                          (shen-lazyderef A V785)
                                          ()))
                                        ())))
                                     (shen-lazyderef Hyp V785)))
                                   V785
                                   V786)))
                                (if
                                 (shen-pvar? V571)
                                 (do
                                  (shen-bindv V571 () V785)
                                  (let
                                   Result
                                   (let
                                    Hyp
                                    (tl V549)
                                    (do
                                     (shen-incinfs)
                                     (bind
                                      V784
                                      (cons
                                       (cons
                                        (shen-lazyderef X V785)
                                        (cons
                                         (intern ":")
                                         (cons
                                          (shen-lazyderef A V785)
                                          ())))
                                       (cons
                                        (cons
                                         (shen-lazyderef Y V785)
                                         (cons
                                          (intern ":")
                                          (cons
                                           (cons
                                            'list
                                            (cons
                                             (shen-lazyderef A V785)
                                             ()))
                                           ())))
                                        (shen-lazyderef Hyp V785)))
                                      V785
                                      V786)))
                                   (do
                                    (shen-unbindv V571 V785)
                                    Result)))
                                 false)))
                              (do (shen-unbindv V559 V785) Result))))
                           false)))
                        false))
                      false))
                    false))
                  false)))
               false)))
            false))
          false))
        false))
      false))
    false))
  (if
   (= Case false)
   (let
    Case
    (let
     V572
     (shen-lazyderef V783 V785)
     (if
      (cons? V572)
      (let
       V573
       (shen-lazyderef (hd V572) V785)
       (if
        (cons? V573)
        (let
         V574
         (shen-lazyderef (hd V573) V785)
         (if
          (cons? V574)
          (let
           V575
           (shen-lazyderef (hd V574) V785)
           (if
            (= '__at__p V575)
            (let
             V576
             (shen-lazyderef (tl V574) V785)
             (if
              (cons? V576)
              (let
               X
               (hd V576)
               (let
                V577
                (shen-lazyderef (tl V576) V785)
                (if
                 (cons? V577)
                 (let
                  Y
                  (hd V577)
                  (let
                   V578
                   (shen-lazyderef (tl V577) V785)
                   (if
                    (= () V578)
                    (let
                     V579
                     (shen-lazyderef (tl V573) V785)
                     (if
                      (cons? V579)
                      (let
                       V580
                       (shen-lazyderef (hd V579) V785)
                       (if
                        (= (intern ":") V580)
                        (let
                         V581
                         (shen-lazyderef (tl V579) V785)
                         (if
                          (cons? V581)
                          (let
                           V582
                           (shen-lazyderef (hd V581) V785)
                           (if
                            (cons? V582)
                            (let
                             A
                             (hd V582)
                             (let
                              V583
                              (shen-lazyderef (tl V582) V785)
                              (if
                               (cons? V583)
                               (let
                                V584
                                (shen-lazyderef (hd V583) V785)
                                (if
                                 (= '* V584)
                                 (let
                                  V585
                                  (shen-lazyderef (tl V583) V785)
                                  (if
                                   (cons? V585)
                                   (let
                                    B
                                    (hd V585)
                                    (let
                                     V586
                                     (shen-lazyderef (tl V585) V785)
                                     (if
                                      (= () V586)
                                      (let
                                       V587
                                       (shen-lazyderef (tl V581) V785)
                                       (if
                                        (= () V587)
                                        (let
                                         Hyp
                                         (tl V572)
                                         (do
                                          (shen-incinfs)
                                          (bind
                                           V784
                                           (cons
                                            (cons
                                             (shen-lazyderef X V785)
                                             (cons
                                              (intern ":")
                                              (cons
                                               (shen-lazyderef A V785)
                                               ())))
                                            (cons
                                             (cons
                                              (shen-lazyderef Y V785)
                                              (cons
                                               (intern ":")
                                               (cons
                                                (shen-lazyderef B V785)
                                                ())))
                                             (shen-lazyderef
                                              Hyp
                                              V785)))
                                           V785
                                           V786)))
                                        (if
                                         (shen-pvar? V587)
                                         (do
                                          (shen-bindv V587 () V785)
                                          (let
                                           Result
                                           (let
                                            Hyp
                                            (tl V572)
                                            (do
                                             (shen-incinfs)
                                             (bind
                                              V784
                                              (cons
                                               (cons
                                                (shen-lazyderef X V785)
                                                (cons
                                                 (intern ":")
                                                 (cons
                                                  (shen-lazyderef
                                                   A
                                                   V785)
                                                  ())))
                                               (cons
                                                (cons
                                                 (shen-lazyderef
                                                  Y
                                                  V785)
                                                 (cons
                                                  (intern ":")
                                                  (cons
                                                   (shen-lazyderef
                                                    B
                                                    V785)
                                                   ())))
                                                (shen-lazyderef
                                                 Hyp
                                                 V785)))
                                              V785
                                              V786)))
                                           (do
                                            (shen-unbindv V587 V785)
                                            Result)))
                                         false)))
                                      (if
                                       (shen-pvar? V586)
                                       (do
                                        (shen-bindv V586 () V785)
                                        (let
                                         Result
                                         (let
                                          V588
                                          (shen-lazyderef
                                           (tl V581)
                                           V785)
                                          (if
                                           (= () V588)
                                           (let
                                            Hyp
                                            (tl V572)
                                            (do
                                             (shen-incinfs)
                                             (bind
                                              V784
                                              (cons
                                               (cons
                                                (shen-lazyderef X V785)
                                                (cons
                                                 (intern ":")
                                                 (cons
                                                  (shen-lazyderef
                                                   A
                                                   V785)
                                                  ())))
                                               (cons
                                                (cons
                                                 (shen-lazyderef
                                                  Y
                                                  V785)
                                                 (cons
                                                  (intern ":")
                                                  (cons
                                                   (shen-lazyderef
                                                    B
                                                    V785)
                                                   ())))
                                                (shen-lazyderef
                                                 Hyp
                                                 V785)))
                                              V785
                                              V786)))
                                           (if
                                            (shen-pvar? V588)
                                            (do
                                             (shen-bindv V588 () V785)
                                             (let
                                              Result
                                              (let
                                               Hyp
                                               (tl V572)
                                               (do
                                                (shen-incinfs)
                                                (bind
                                                 V784
                                                 (cons
                                                  (cons
                                                   (shen-lazyderef
                                                    X
                                                    V785)
                                                   (cons
                                                    (intern ":")
                                                    (cons
                                                     (shen-lazyderef
                                                      A
                                                      V785)
                                                     ())))
                                                  (cons
                                                   (cons
                                                    (shen-lazyderef
                                                     Y
                                                     V785)
                                                    (cons
                                                     (intern ":")
                                                     (cons
                                                      (shen-lazyderef
                                                       B
                                                       V785)
                                                      ())))
                                                   (shen-lazyderef
                                                    Hyp
                                                    V785)))
                                                 V785
                                                 V786)))
                                              (do
                                               (shen-unbindv V588 V785)
                                               Result)))
                                            false)))
                                         (do
                                          (shen-unbindv V586 V785)
                                          Result)))
                                       false))))
                                   (if
                                    (shen-pvar? V585)
                                    (let
                                     B
                                     (shen-newpv V785)
                                     (do
                                      (shen-bindv
                                       V585
                                       (cons B ())
                                       V785)
                                      (let
                                       Result
                                       (let
                                        V589
                                        (shen-lazyderef (tl V581) V785)
                                        (if
                                         (= () V589)
                                         (let
                                          Hyp
                                          (tl V572)
                                          (do
                                           (shen-incinfs)
                                           (bind
                                            V784
                                            (cons
                                             (cons
                                              (shen-lazyderef X V785)
                                              (cons
                                               (intern ":")
                                               (cons
                                                (shen-lazyderef A V785)
                                                ())))
                                             (cons
                                              (cons
                                               (shen-lazyderef Y V785)
                                               (cons
                                                (intern ":")
                                                (cons
                                                 (shen-lazyderef
                                                  B
                                                  V785)
                                                 ())))
                                              (shen-lazyderef
                                               Hyp
                                               V785)))
                                            V785
                                            V786)))
                                         (if
                                          (shen-pvar? V589)
                                          (do
                                           (shen-bindv V589 () V785)
                                           (let
                                            Result
                                            (let
                                             Hyp
                                             (tl V572)
                                             (do
                                              (shen-incinfs)
                                              (bind
                                               V784
                                               (cons
                                                (cons
                                                 (shen-lazyderef
                                                  X
                                                  V785)
                                                 (cons
                                                  (intern ":")
                                                  (cons
                                                   (shen-lazyderef
                                                    A
                                                    V785)
                                                   ())))
                                                (cons
                                                 (cons
                                                  (shen-lazyderef
                                                   Y
                                                   V785)
                                                  (cons
                                                   (intern ":")
                                                   (cons
                                                    (shen-lazyderef
                                                     B
                                                     V785)
                                                    ())))
                                                 (shen-lazyderef
                                                  Hyp
                                                  V785)))
                                               V785
                                               V786)))
                                            (do
                                             (shen-unbindv V589 V785)
                                             Result)))
                                          false)))
                                       (do
                                        (shen-unbindv V585 V785)
                                        Result))))
                                    false)))
                                 (if
                                  (shen-pvar? V584)
                                  (do
                                   (shen-bindv V584 '* V785)
                                   (let
                                    Result
                                    (let
                                     V590
                                     (shen-lazyderef (tl V583) V785)
                                     (if
                                      (cons? V590)
                                      (let
                                       B
                                       (hd V590)
                                       (let
                                        V591
                                        (shen-lazyderef (tl V590) V785)
                                        (if
                                         (= () V591)
                                         (let
                                          V592
                                          (shen-lazyderef
                                           (tl V581)
                                           V785)
                                          (if
                                           (= () V592)
                                           (let
                                            Hyp
                                            (tl V572)
                                            (do
                                             (shen-incinfs)
                                             (bind
                                              V784
                                              (cons
                                               (cons
                                                (shen-lazyderef X V785)
                                                (cons
                                                 (intern ":")
                                                 (cons
                                                  (shen-lazyderef
                                                   A
                                                   V785)
                                                  ())))
                                               (cons
                                                (cons
                                                 (shen-lazyderef
                                                  Y
                                                  V785)
                                                 (cons
                                                  (intern ":")
                                                  (cons
                                                   (shen-lazyderef
                                                    B
                                                    V785)
                                                   ())))
                                                (shen-lazyderef
                                                 Hyp
                                                 V785)))
                                              V785
                                              V786)))
                                           (if
                                            (shen-pvar? V592)
                                            (do
                                             (shen-bindv V592 () V785)
                                             (let
                                              Result
                                              (let
                                               Hyp
                                               (tl V572)
                                               (do
                                                (shen-incinfs)
                                                (bind
                                                 V784
                                                 (cons
                                                  (cons
                                                   (shen-lazyderef
                                                    X
                                                    V785)
                                                   (cons
                                                    (intern ":")
                                                    (cons
                                                     (shen-lazyderef
                                                      A
                                                      V785)
                                                     ())))
                                                  (cons
                                                   (cons
                                                    (shen-lazyderef
                                                     Y
                                                     V785)
                                                    (cons
                                                     (intern ":")
                                                     (cons
                                                      (shen-lazyderef
                                                       B
                                                       V785)
                                                      ())))
                                                   (shen-lazyderef
                                                    Hyp
                                                    V785)))
                                                 V785
                                                 V786)))
                                              (do
                                               (shen-unbindv V592 V785)
                                               Result)))
                                            false)))
                                         (if
                                          (shen-pvar? V591)
                                          (do
                                           (shen-bindv V591 () V785)
                                           (let
                                            Result
                                            (let
                                             V593
                                             (shen-lazyderef
                                              (tl V581)
                                              V785)
                                             (if
                                              (= () V593)
                                              (let
                                               Hyp
                                               (tl V572)
                                               (do
                                                (shen-incinfs)
                                                (bind
                                                 V784
                                                 (cons
                                                  (cons
                                                   (shen-lazyderef
                                                    X
                                                    V785)
                                                   (cons
                                                    (intern ":")
                                                    (cons
                                                     (shen-lazyderef
                                                      A
                                                      V785)
                                                     ())))
                                                  (cons
                                                   (cons
                                                    (shen-lazyderef
                                                     Y
                                                     V785)
                                                    (cons
                                                     (intern ":")
                                                     (cons
                                                      (shen-lazyderef
                                                       B
                                                       V785)
                                                      ())))
                                                   (shen-lazyderef
                                                    Hyp
                                                    V785)))
                                                 V785
                                                 V786)))
                                              (if
                                               (shen-pvar? V593)
                                               (do
                                                (shen-bindv
                                                 V593
                                                 ()
                                                 V785)
                                                (let
                                                 Result
                                                 (let
                                                  Hyp
                                                  (tl V572)
                                                  (do
                                                   (shen-incinfs)
                                                   (bind
                                                    V784
                                                    (cons
                                                     (cons
                                                      (shen-lazyderef
                                                       X
                                                       V785)
                                                      (cons
                                                       (intern ":")
                                                       (cons
                                                        (shen-lazyderef
                                                         A
                                                         V785)
                                                        ())))
                                                     (cons
                                                      (cons
                                                       (shen-lazyderef
                                                        Y
                                                        V785)
                                                       (cons
                                                        (intern ":")
                                                        (cons
                                                         (shen-lazyderef
                                                          B
                                                          V785)
                                                         ())))
                                                      (shen-lazyderef
                                                       Hyp
                                                       V785)))
                                                    V785
                                                    V786)))
                                                 (do
                                                  (shen-unbindv
                                                   V593
                                                   V785)
                                                  Result)))
                                               false)))
                                            (do
                                             (shen-unbindv V591 V785)
                                             Result)))
                                          false))))
                                      (if
                                       (shen-pvar? V590)
                                       (let
                                        B
                                        (shen-newpv V785)
                                        (do
                                         (shen-bindv
                                          V590
                                          (cons B ())
                                          V785)
                                         (let
                                          Result
                                          (let
                                           V594
                                           (shen-lazyderef
                                            (tl V581)
                                            V785)
                                           (if
                                            (= () V594)
                                            (let
                                             Hyp
                                             (tl V572)
                                             (do
                                              (shen-incinfs)
                                              (bind
                                               V784
                                               (cons
                                                (cons
                                                 (shen-lazyderef
                                                  X
                                                  V785)
                                                 (cons
                                                  (intern ":")
                                                  (cons
                                                   (shen-lazyderef
                                                    A
                                                    V785)
                                                   ())))
                                                (cons
                                                 (cons
                                                  (shen-lazyderef
                                                   Y
                                                   V785)
                                                  (cons
                                                   (intern ":")
                                                   (cons
                                                    (shen-lazyderef
                                                     B
                                                     V785)
                                                    ())))
                                                 (shen-lazyderef
                                                  Hyp
                                                  V785)))
                                               V785
                                               V786)))
                                            (if
                                             (shen-pvar? V594)
                                             (do
                                              (shen-bindv V594 () V785)
                                              (let
                                               Result
                                               (let
                                                Hyp
                                                (tl V572)
                                                (do
                                                 (shen-incinfs)
                                                 (bind
                                                  V784
                                                  (cons
                                                   (cons
                                                    (shen-lazyderef
                                                     X
                                                     V785)
                                                    (cons
                                                     (intern ":")
                                                     (cons
                                                      (shen-lazyderef
                                                       A
                                                       V785)
                                                      ())))
                                                   (cons
                                                    (cons
                                                     (shen-lazyderef
                                                      Y
                                                      V785)
                                                     (cons
                                                      (intern ":")
                                                      (cons
                                                       (shen-lazyderef
                                                        B
                                                        V785)
                                                       ())))
                                                    (shen-lazyderef
                                                     Hyp
                                                     V785)))
                                                  V785
                                                  V786)))
                                               (do
                                                (shen-unbindv
                                                 V594
                                                 V785)
                                                Result)))
                                             false)))
                                          (do
                                           (shen-unbindv V590 V785)
                                           Result))))
                                       false)))
                                    (do
                                     (shen-unbindv V584 V785)
                                     Result)))
                                  false)))
                               (if
                                (shen-pvar? V583)
                                (let
                                 B
                                 (shen-newpv V785)
                                 (do
                                  (shen-bindv
                                   V583
                                   (cons '* (cons B ()))
                                   V785)
                                  (let
                                   Result
                                   (let
                                    V595
                                    (shen-lazyderef (tl V581) V785)
                                    (if
                                     (= () V595)
                                     (let
                                      Hyp
                                      (tl V572)
                                      (do
                                       (shen-incinfs)
                                       (bind
                                        V784
                                        (cons
                                         (cons
                                          (shen-lazyderef X V785)
                                          (cons
                                           (intern ":")
                                           (cons
                                            (shen-lazyderef A V785)
                                            ())))
                                         (cons
                                          (cons
                                           (shen-lazyderef Y V785)
                                           (cons
                                            (intern ":")
                                            (cons
                                             (shen-lazyderef B V785)
                                             ())))
                                          (shen-lazyderef Hyp V785)))
                                        V785
                                        V786)))
                                     (if
                                      (shen-pvar? V595)
                                      (do
                                       (shen-bindv V595 () V785)
                                       (let
                                        Result
                                        (let
                                         Hyp
                                         (tl V572)
                                         (do
                                          (shen-incinfs)
                                          (bind
                                           V784
                                           (cons
                                            (cons
                                             (shen-lazyderef X V785)
                                             (cons
                                              (intern ":")
                                              (cons
                                               (shen-lazyderef A V785)
                                               ())))
                                            (cons
                                             (cons
                                              (shen-lazyderef Y V785)
                                              (cons
                                               (intern ":")
                                               (cons
                                                (shen-lazyderef B V785)
                                                ())))
                                             (shen-lazyderef
                                              Hyp
                                              V785)))
                                           V785
                                           V786)))
                                        (do
                                         (shen-unbindv V595 V785)
                                         Result)))
                                      false)))
                                   (do
                                    (shen-unbindv V583 V785)
                                    Result))))
                                false))))
                            (if
                             (shen-pvar? V582)
                             (let
                              A
                              (shen-newpv V785)
                              (let
                               B
                               (shen-newpv V785)
                               (do
                                (shen-bindv
                                 V582
                                 (cons A (cons '* (cons B ())))
                                 V785)
                                (let
                                 Result
                                 (let
                                  V596
                                  (shen-lazyderef (tl V581) V785)
                                  (if
                                   (= () V596)
                                   (let
                                    Hyp
                                    (tl V572)
                                    (do
                                     (shen-incinfs)
                                     (bind
                                      V784
                                      (cons
                                       (cons
                                        (shen-lazyderef X V785)
                                        (cons
                                         (intern ":")
                                         (cons
                                          (shen-lazyderef A V785)
                                          ())))
                                       (cons
                                        (cons
                                         (shen-lazyderef Y V785)
                                         (cons
                                          (intern ":")
                                          (cons
                                           (shen-lazyderef B V785)
                                           ())))
                                        (shen-lazyderef Hyp V785)))
                                      V785
                                      V786)))
                                   (if
                                    (shen-pvar? V596)
                                    (do
                                     (shen-bindv V596 () V785)
                                     (let
                                      Result
                                      (let
                                       Hyp
                                       (tl V572)
                                       (do
                                        (shen-incinfs)
                                        (bind
                                         V784
                                         (cons
                                          (cons
                                           (shen-lazyderef X V785)
                                           (cons
                                            (intern ":")
                                            (cons
                                             (shen-lazyderef A V785)
                                             ())))
                                          (cons
                                           (cons
                                            (shen-lazyderef Y V785)
                                            (cons
                                             (intern ":")
                                             (cons
                                              (shen-lazyderef B V785)
                                              ())))
                                           (shen-lazyderef Hyp V785)))
                                         V785
                                         V786)))
                                      (do
                                       (shen-unbindv V596 V785)
                                       Result)))
                                    false)))
                                 (do
                                  (shen-unbindv V582 V785)
                                  Result)))))
                             false)))
                          false))
                        false))
                      false))
                    false)))
                 false)))
              false))
            false))
          false))
        false))
      false))
    (if
     (= Case false)
     (let
      Case
      (let
       V597
       (shen-lazyderef V783 V785)
       (if
        (cons? V597)
        (let
         V598
         (shen-lazyderef (hd V597) V785)
         (if
          (cons? V598)
          (let
           V599
           (shen-lazyderef (hd V598) V785)
           (if
            (cons? V599)
            (let
             V600
             (shen-lazyderef (hd V599) V785)
             (if
              (= '__at__v V600)
              (let
               V601
               (shen-lazyderef (tl V599) V785)
               (if
                (cons? V601)
                (let
                 X
                 (hd V601)
                 (let
                  V602
                  (shen-lazyderef (tl V601) V785)
                  (if
                   (cons? V602)
                   (let
                    Y
                    (hd V602)
                    (let
                     V603
                     (shen-lazyderef (tl V602) V785)
                     (if
                      (= () V603)
                      (let
                       V604
                       (shen-lazyderef (tl V598) V785)
                       (if
                        (cons? V604)
                        (let
                         V605
                         (shen-lazyderef (hd V604) V785)
                         (if
                          (= (intern ":") V605)
                          (let
                           V606
                           (shen-lazyderef (tl V604) V785)
                           (if
                            (cons? V606)
                            (let
                             V607
                             (shen-lazyderef (hd V606) V785)
                             (if
                              (cons? V607)
                              (let
                               V608
                               (shen-lazyderef (hd V607) V785)
                               (if
                                (= 'vector V608)
                                (let
                                 V609
                                 (shen-lazyderef (tl V607) V785)
                                 (if
                                  (cons? V609)
                                  (let
                                   A
                                   (hd V609)
                                   (let
                                    V610
                                    (shen-lazyderef (tl V609) V785)
                                    (if
                                     (= () V610)
                                     (let
                                      V611
                                      (shen-lazyderef (tl V606) V785)
                                      (if
                                       (= () V611)
                                       (let
                                        Hyp
                                        (tl V597)
                                        (do
                                         (shen-incinfs)
                                         (bind
                                          V784
                                          (cons
                                           (cons
                                            (shen-lazyderef X V785)
                                            (cons
                                             (intern ":")
                                             (cons
                                              (shen-lazyderef A V785)
                                              ())))
                                           (cons
                                            (cons
                                             (shen-lazyderef Y V785)
                                             (cons
                                              (intern ":")
                                              (cons
                                               (cons
                                                'vector
                                                (cons
                                                 (shen-lazyderef
                                                  A
                                                  V785)
                                                 ()))
                                               ())))
                                            (shen-lazyderef Hyp V785)))
                                          V785
                                          V786)))
                                       (if
                                        (shen-pvar? V611)
                                        (do
                                         (shen-bindv V611 () V785)
                                         (let
                                          Result
                                          (let
                                           Hyp
                                           (tl V597)
                                           (do
                                            (shen-incinfs)
                                            (bind
                                             V784
                                             (cons
                                              (cons
                                               (shen-lazyderef X V785)
                                               (cons
                                                (intern ":")
                                                (cons
                                                 (shen-lazyderef
                                                  A
                                                  V785)
                                                 ())))
                                              (cons
                                               (cons
                                                (shen-lazyderef Y V785)
                                                (cons
                                                 (intern ":")
                                                 (cons
                                                  (cons
                                                   'vector
                                                   (cons
                                                    (shen-lazyderef
                                                     A
                                                     V785)
                                                    ()))
                                                  ())))
                                               (shen-lazyderef
                                                Hyp
                                                V785)))
                                             V785
                                             V786)))
                                          (do
                                           (shen-unbindv V611 V785)
                                           Result)))
                                        false)))
                                     (if
                                      (shen-pvar? V610)
                                      (do
                                       (shen-bindv V610 () V785)
                                       (let
                                        Result
                                        (let
                                         V612
                                         (shen-lazyderef
                                          (tl V606)
                                          V785)
                                         (if
                                          (= () V612)
                                          (let
                                           Hyp
                                           (tl V597)
                                           (do
                                            (shen-incinfs)
                                            (bind
                                             V784
                                             (cons
                                              (cons
                                               (shen-lazyderef X V785)
                                               (cons
                                                (intern ":")
                                                (cons
                                                 (shen-lazyderef
                                                  A
                                                  V785)
                                                 ())))
                                              (cons
                                               (cons
                                                (shen-lazyderef Y V785)
                                                (cons
                                                 (intern ":")
                                                 (cons
                                                  (cons
                                                   'vector
                                                   (cons
                                                    (shen-lazyderef
                                                     A
                                                     V785)
                                                    ()))
                                                  ())))
                                               (shen-lazyderef
                                                Hyp
                                                V785)))
                                             V785
                                             V786)))
                                          (if
                                           (shen-pvar? V612)
                                           (do
                                            (shen-bindv V612 () V785)
                                            (let
                                             Result
                                             (let
                                              Hyp
                                              (tl V597)
                                              (do
                                               (shen-incinfs)
                                               (bind
                                                V784
                                                (cons
                                                 (cons
                                                  (shen-lazyderef
                                                   X
                                                   V785)
                                                  (cons
                                                   (intern ":")
                                                   (cons
                                                    (shen-lazyderef
                                                     A
                                                     V785)
                                                    ())))
                                                 (cons
                                                  (cons
                                                   (shen-lazyderef
                                                    Y
                                                    V785)
                                                   (cons
                                                    (intern ":")
                                                    (cons
                                                     (cons
                                                      'vector
                                                      (cons
                                                       (shen-lazyderef
                                                        A
                                                        V785)
                                                       ()))
                                                     ())))
                                                  (shen-lazyderef
                                                   Hyp
                                                   V785)))
                                                V785
                                                V786)))
                                             (do
                                              (shen-unbindv V612 V785)
                                              Result)))
                                           false)))
                                        (do
                                         (shen-unbindv V610 V785)
                                         Result)))
                                      false))))
                                  (if
                                   (shen-pvar? V609)
                                   (let
                                    A
                                    (shen-newpv V785)
                                    (do
                                     (shen-bindv V609 (cons A ()) V785)
                                     (let
                                      Result
                                      (let
                                       V613
                                       (shen-lazyderef (tl V606) V785)
                                       (if
                                        (= () V613)
                                        (let
                                         Hyp
                                         (tl V597)
                                         (do
                                          (shen-incinfs)
                                          (bind
                                           V784
                                           (cons
                                            (cons
                                             (shen-lazyderef X V785)
                                             (cons
                                              (intern ":")
                                              (cons
                                               (shen-lazyderef A V785)
                                               ())))
                                            (cons
                                             (cons
                                              (shen-lazyderef Y V785)
                                              (cons
                                               (intern ":")
                                               (cons
                                                (cons
                                                 'vector
                                                 (cons
                                                  (shen-lazyderef
                                                   A
                                                   V785)
                                                  ()))
                                                ())))
                                             (shen-lazyderef
                                              Hyp
                                              V785)))
                                           V785
                                           V786)))
                                        (if
                                         (shen-pvar? V613)
                                         (do
                                          (shen-bindv V613 () V785)
                                          (let
                                           Result
                                           (let
                                            Hyp
                                            (tl V597)
                                            (do
                                             (shen-incinfs)
                                             (bind
                                              V784
                                              (cons
                                               (cons
                                                (shen-lazyderef X V785)
                                                (cons
                                                 (intern ":")
                                                 (cons
                                                  (shen-lazyderef
                                                   A
                                                   V785)
                                                  ())))
                                               (cons
                                                (cons
                                                 (shen-lazyderef
                                                  Y
                                                  V785)
                                                 (cons
                                                  (intern ":")
                                                  (cons
                                                   (cons
                                                    'vector
                                                    (cons
                                                     (shen-lazyderef
                                                      A
                                                      V785)
                                                     ()))
                                                   ())))
                                                (shen-lazyderef
                                                 Hyp
                                                 V785)))
                                              V785
                                              V786)))
                                           (do
                                            (shen-unbindv V613 V785)
                                            Result)))
                                         false)))
                                      (do
                                       (shen-unbindv V609 V785)
                                       Result))))
                                   false)))
                                (if
                                 (shen-pvar? V608)
                                 (do
                                  (shen-bindv V608 'vector V785)
                                  (let
                                   Result
                                   (let
                                    V614
                                    (shen-lazyderef (tl V607) V785)
                                    (if
                                     (cons? V614)
                                     (let
                                      A
                                      (hd V614)
                                      (let
                                       V615
                                       (shen-lazyderef (tl V614) V785)
                                       (if
                                        (= () V615)
                                        (let
                                         V616
                                         (shen-lazyderef
                                          (tl V606)
                                          V785)
                                         (if
                                          (= () V616)
                                          (let
                                           Hyp
                                           (tl V597)
                                           (do
                                            (shen-incinfs)
                                            (bind
                                             V784
                                             (cons
                                              (cons
                                               (shen-lazyderef X V785)
                                               (cons
                                                (intern ":")
                                                (cons
                                                 (shen-lazyderef
                                                  A
                                                  V785)
                                                 ())))
                                              (cons
                                               (cons
                                                (shen-lazyderef Y V785)
                                                (cons
                                                 (intern ":")
                                                 (cons
                                                  (cons
                                                   'vector
                                                   (cons
                                                    (shen-lazyderef
                                                     A
                                                     V785)
                                                    ()))
                                                  ())))
                                               (shen-lazyderef
                                                Hyp
                                                V785)))
                                             V785
                                             V786)))
                                          (if
                                           (shen-pvar? V616)
                                           (do
                                            (shen-bindv V616 () V785)
                                            (let
                                             Result
                                             (let
                                              Hyp
                                              (tl V597)
                                              (do
                                               (shen-incinfs)
                                               (bind
                                                V784
                                                (cons
                                                 (cons
                                                  (shen-lazyderef
                                                   X
                                                   V785)
                                                  (cons
                                                   (intern ":")
                                                   (cons
                                                    (shen-lazyderef
                                                     A
                                                     V785)
                                                    ())))
                                                 (cons
                                                  (cons
                                                   (shen-lazyderef
                                                    Y
                                                    V785)
                                                   (cons
                                                    (intern ":")
                                                    (cons
                                                     (cons
                                                      'vector
                                                      (cons
                                                       (shen-lazyderef
                                                        A
                                                        V785)
                                                       ()))
                                                     ())))
                                                  (shen-lazyderef
                                                   Hyp
                                                   V785)))
                                                V785
                                                V786)))
                                             (do
                                              (shen-unbindv V616 V785)
                                              Result)))
                                           false)))
                                        (if
                                         (shen-pvar? V615)
                                         (do
                                          (shen-bindv V615 () V785)
                                          (let
                                           Result
                                           (let
                                            V617
                                            (shen-lazyderef
                                             (tl V606)
                                             V785)
                                            (if
                                             (= () V617)
                                             (let
                                              Hyp
                                              (tl V597)
                                              (do
                                               (shen-incinfs)
                                               (bind
                                                V784
                                                (cons
                                                 (cons
                                                  (shen-lazyderef
                                                   X
                                                   V785)
                                                  (cons
                                                   (intern ":")
                                                   (cons
                                                    (shen-lazyderef
                                                     A
                                                     V785)
                                                    ())))
                                                 (cons
                                                  (cons
                                                   (shen-lazyderef
                                                    Y
                                                    V785)
                                                   (cons
                                                    (intern ":")
                                                    (cons
                                                     (cons
                                                      'vector
                                                      (cons
                                                       (shen-lazyderef
                                                        A
                                                        V785)
                                                       ()))
                                                     ())))
                                                  (shen-lazyderef
                                                   Hyp
                                                   V785)))
                                                V785
                                                V786)))
                                             (if
                                              (shen-pvar? V617)
                                              (do
                                               (shen-bindv
                                                V617
                                                ()
                                                V785)
                                               (let
                                                Result
                                                (let
                                                 Hyp
                                                 (tl V597)
                                                 (do
                                                  (shen-incinfs)
                                                  (bind
                                                   V784
                                                   (cons
                                                    (cons
                                                     (shen-lazyderef
                                                      X
                                                      V785)
                                                     (cons
                                                      (intern ":")
                                                      (cons
                                                       (shen-lazyderef
                                                        A
                                                        V785)
                                                       ())))
                                                    (cons
                                                     (cons
                                                      (shen-lazyderef
                                                       Y
                                                       V785)
                                                      (cons
                                                       (intern ":")
                                                       (cons
                                                        (cons
                                                         'vector
                                                         (cons
                                                          (shen-lazyderef
                                                           A
                                                           V785)
                                                          ()))
                                                        ())))
                                                     (shen-lazyderef
                                                      Hyp
                                                      V785)))
                                                   V785
                                                   V786)))
                                                (do
                                                 (shen-unbindv
                                                  V617
                                                  V785)
                                                 Result)))
                                              false)))
                                           (do
                                            (shen-unbindv V615 V785)
                                            Result)))
                                         false))))
                                     (if
                                      (shen-pvar? V614)
                                      (let
                                       A
                                       (shen-newpv V785)
                                       (do
                                        (shen-bindv
                                         V614
                                         (cons A ())
                                         V785)
                                        (let
                                         Result
                                         (let
                                          V618
                                          (shen-lazyderef
                                           (tl V606)
                                           V785)
                                          (if
                                           (= () V618)
                                           (let
                                            Hyp
                                            (tl V597)
                                            (do
                                             (shen-incinfs)
                                             (bind
                                              V784
                                              (cons
                                               (cons
                                                (shen-lazyderef X V785)
                                                (cons
                                                 (intern ":")
                                                 (cons
                                                  (shen-lazyderef
                                                   A
                                                   V785)
                                                  ())))
                                               (cons
                                                (cons
                                                 (shen-lazyderef
                                                  Y
                                                  V785)
                                                 (cons
                                                  (intern ":")
                                                  (cons
                                                   (cons
                                                    'vector
                                                    (cons
                                                     (shen-lazyderef
                                                      A
                                                      V785)
                                                     ()))
                                                   ())))
                                                (shen-lazyderef
                                                 Hyp
                                                 V785)))
                                              V785
                                              V786)))
                                           (if
                                            (shen-pvar? V618)
                                            (do
                                             (shen-bindv V618 () V785)
                                             (let
                                              Result
                                              (let
                                               Hyp
                                               (tl V597)
                                               (do
                                                (shen-incinfs)
                                                (bind
                                                 V784
                                                 (cons
                                                  (cons
                                                   (shen-lazyderef
                                                    X
                                                    V785)
                                                   (cons
                                                    (intern ":")
                                                    (cons
                                                     (shen-lazyderef
                                                      A
                                                      V785)
                                                     ())))
                                                  (cons
                                                   (cons
                                                    (shen-lazyderef
                                                     Y
                                                     V785)
                                                    (cons
                                                     (intern ":")
                                                     (cons
                                                      (cons
                                                       'vector
                                                       (cons
                                                        (shen-lazyderef
                                                         A
                                                         V785)
                                                        ()))
                                                      ())))
                                                   (shen-lazyderef
                                                    Hyp
                                                    V785)))
                                                 V785
                                                 V786)))
                                              (do
                                               (shen-unbindv V618 V785)
                                               Result)))
                                            false)))
                                         (do
                                          (shen-unbindv V614 V785)
                                          Result))))
                                      false)))
                                   (do
                                    (shen-unbindv V608 V785)
                                    Result)))
                                 false)))
                              (if
                               (shen-pvar? V607)
                               (let
                                A
                                (shen-newpv V785)
                                (do
                                 (shen-bindv
                                  V607
                                  (cons 'vector (cons A ()))
                                  V785)
                                 (let
                                  Result
                                  (let
                                   V619
                                   (shen-lazyderef (tl V606) V785)
                                   (if
                                    (= () V619)
                                    (let
                                     Hyp
                                     (tl V597)
                                     (do
                                      (shen-incinfs)
                                      (bind
                                       V784
                                       (cons
                                        (cons
                                         (shen-lazyderef X V785)
                                         (cons
                                          (intern ":")
                                          (cons
                                           (shen-lazyderef A V785)
                                           ())))
                                        (cons
                                         (cons
                                          (shen-lazyderef Y V785)
                                          (cons
                                           (intern ":")
                                           (cons
                                            (cons
                                             'vector
                                             (cons
                                              (shen-lazyderef A V785)
                                              ()))
                                            ())))
                                         (shen-lazyderef Hyp V785)))
                                       V785
                                       V786)))
                                    (if
                                     (shen-pvar? V619)
                                     (do
                                      (shen-bindv V619 () V785)
                                      (let
                                       Result
                                       (let
                                        Hyp
                                        (tl V597)
                                        (do
                                         (shen-incinfs)
                                         (bind
                                          V784
                                          (cons
                                           (cons
                                            (shen-lazyderef X V785)
                                            (cons
                                             (intern ":")
                                             (cons
                                              (shen-lazyderef A V785)
                                              ())))
                                           (cons
                                            (cons
                                             (shen-lazyderef Y V785)
                                             (cons
                                              (intern ":")
                                              (cons
                                               (cons
                                                'vector
                                                (cons
                                                 (shen-lazyderef
                                                  A
                                                  V785)
                                                 ()))
                                               ())))
                                            (shen-lazyderef Hyp V785)))
                                          V785
                                          V786)))
                                       (do
                                        (shen-unbindv V619 V785)
                                        Result)))
                                     false)))
                                  (do
                                   (shen-unbindv V607 V785)
                                   Result))))
                               false)))
                            false))
                          false))
                        false))
                      false)))
                   false)))
                false))
              false))
            false))
          false))
        false))
      (if
       (= Case false)
       (let
        Case
        (let
         V620
         (shen-lazyderef V783 V785)
         (if
          (cons? V620)
          (let
           V621
           (shen-lazyderef (hd V620) V785)
           (if
            (cons? V621)
            (let
             V622
             (shen-lazyderef (hd V621) V785)
             (if
              (cons? V622)
              (let
               V623
               (shen-lazyderef (hd V622) V785)
               (if
                (= '__at__s V623)
                (let
                 V624
                 (shen-lazyderef (tl V622) V785)
                 (if
                  (cons? V624)
                  (let
                   X
                   (hd V624)
                   (let
                    V625
                    (shen-lazyderef (tl V624) V785)
                    (if
                     (cons? V625)
                     (let
                      Y
                      (hd V625)
                      (let
                       V626
                       (shen-lazyderef (tl V625) V785)
                       (if
                        (= () V626)
                        (let
                         V627
                         (shen-lazyderef (tl V621) V785)
                         (if
                          (cons? V627)
                          (let
                           V628
                           (shen-lazyderef (hd V627) V785)
                           (if
                            (= (intern ":") V628)
                            (let
                             V629
                             (shen-lazyderef (tl V627) V785)
                             (if
                              (cons? V629)
                              (let
                               V630
                               (shen-lazyderef (hd V629) V785)
                               (if
                                (= 'string V630)
                                (let
                                 V631
                                 (shen-lazyderef (tl V629) V785)
                                 (if
                                  (= () V631)
                                  (let
                                   Hyp
                                   (tl V620)
                                   (do
                                    (shen-incinfs)
                                    (bind
                                     V784
                                     (cons
                                      (cons
                                       (shen-lazyderef X V785)
                                       (cons
                                        (intern ":")
                                        (cons 'string ())))
                                      (cons
                                       (cons
                                        (shen-lazyderef Y V785)
                                        (cons
                                         (intern ":")
                                         (cons 'string ())))
                                       (shen-lazyderef Hyp V785)))
                                     V785
                                     V786)))
                                  (if
                                   (shen-pvar? V631)
                                   (do
                                    (shen-bindv V631 () V785)
                                    (let
                                     Result
                                     (let
                                      Hyp
                                      (tl V620)
                                      (do
                                       (shen-incinfs)
                                       (bind
                                        V784
                                        (cons
                                         (cons
                                          (shen-lazyderef X V785)
                                          (cons
                                           (intern ":")
                                           (cons 'string ())))
                                         (cons
                                          (cons
                                           (shen-lazyderef Y V785)
                                           (cons
                                            (intern ":")
                                            (cons 'string ())))
                                          (shen-lazyderef Hyp V785)))
                                        V785
                                        V786)))
                                     (do
                                      (shen-unbindv V631 V785)
                                      Result)))
                                   false)))
                                (if
                                 (shen-pvar? V630)
                                 (do
                                  (shen-bindv V630 'string V785)
                                  (let
                                   Result
                                   (let
                                    V632
                                    (shen-lazyderef (tl V629) V785)
                                    (if
                                     (= () V632)
                                     (let
                                      Hyp
                                      (tl V620)
                                      (do
                                       (shen-incinfs)
                                       (bind
                                        V784
                                        (cons
                                         (cons
                                          (shen-lazyderef X V785)
                                          (cons
                                           (intern ":")
                                           (cons 'string ())))
                                         (cons
                                          (cons
                                           (shen-lazyderef Y V785)
                                           (cons
                                            (intern ":")
                                            (cons 'string ())))
                                          (shen-lazyderef Hyp V785)))
                                        V785
                                        V786)))
                                     (if
                                      (shen-pvar? V632)
                                      (do
                                       (shen-bindv V632 () V785)
                                       (let
                                        Result
                                        (let
                                         Hyp
                                         (tl V620)
                                         (do
                                          (shen-incinfs)
                                          (bind
                                           V784
                                           (cons
                                            (cons
                                             (shen-lazyderef X V785)
                                             (cons
                                              (intern ":")
                                              (cons 'string ())))
                                            (cons
                                             (cons
                                              (shen-lazyderef Y V785)
                                              (cons
                                               (intern ":")
                                               (cons 'string ())))
                                             (shen-lazyderef
                                              Hyp
                                              V785)))
                                           V785
                                           V786)))
                                        (do
                                         (shen-unbindv V632 V785)
                                         Result)))
                                      false)))
                                   (do
                                    (shen-unbindv V630 V785)
                                    Result)))
                                 false)))
                              false))
                            false))
                          false))
                        false)))
                     false)))
                  false))
                false))
              false))
            false))
          false))
        (if
         (= Case false)
         (let
          V633
          (shen-lazyderef V783 V785)
          (if
           (cons? V633)
           (let
            X
            (hd V633)
            (let
             Hyp
             (tl V633)
             (let
              NewHyps
              (shen-newpv V785)
              (do
               (shen-incinfs)
               (bind
                V784
                (cons
                 (shen-lazyderef X V785)
                 (shen-lazyderef NewHyps V785))
                V785
                (freeze (shen-t*-hyps Hyp NewHyps V785 V786)))))))
           false))
         Case))
       Case))
     Case))
   Case)))

(defun
 shen-show
 (V799 V800 V801 V802)
 (cond
  ((value 'shen-*spy*)
   (do
    (shen-line)
    (do
     (shen-show-p (shen-deref V799 V801))
     (do
      (nl 1)
      (do
       (nl 1)
       (do
        (shen-show-assumptions (shen-deref V800 V801) 1)
        (do
         (intoutput "~%> " ())
         (do
          (shen-pause-for-user (value '*language*))
          (thaw V802)))))))))
  (true (thaw V802))))

(defun
 shen-line
 ()
 (let
  Infs
  (inferences '_)
  (intoutput
   "____________________________________________________________ ~A inference~A ~%?- "
   (__at__p Infs (__at__p (if (= 1 Infs) "" "s") ())))))

(defun
 shen-show-p
 (V803)
 (cond
  ((and
    (cons? V803)
    (and
     (cons? (tl V803))
     (and
      (= (intern ":") (hd (tl V803)))
      (and (cons? (tl (tl V803))) (= () (tl (tl (tl V803))))))))
   (intoutput
    "~R : ~R"
    (__at__p (hd V803) (__at__p (hd (tl (tl V803))) ()))))
  (true (intoutput "~R" (__at__p V803 ())))))

(defun
 shen-show-assumptions
 (V806 V807)
 (cond
  ((= () V806) 'shen-skip)
  ((cons? V806)
   (do
    (intoutput "~A. " (__at__p V807 ()))
    (do
     (shen-show-p (hd V806))
     (do (nl 1) (shen-show-assumptions (tl V806) (+ V807 1))))))
  (true (shen-f_error 'shen-show-assumptions))))

(defun
 shen-pause-for-user
 (V812)
 (cond
  ((= "Common Lisp" V812)
   (let
    I
    (FORMAT () "~C" (READ-CHAR))
    (if (= I "a") (interror "input aborted~%" ()) (nl 1))))
  (true
   (let
    I
    (shen-read-char)
    (if (= I "a") (interror "input aborted~%" ()) (nl 1))))))

(defun shen-read-char () (shen-read-char-h (read-byte (stinput 0)) 0))

(defun
 shen-read-char-h
 (V815 V816)
 (cond
  ((and (= -1 V815) (= 0 V816)) (recur (read-byte (stinput 0)) 1))
  ((= 0 V816) (recur (read-byte (stinput 0)) 0))
  ((and (= -1 V815) (= 1 V816)) (recur (read-byte (stinput 0)) 1))
  ((= 1 V816) (byte->string V815))
  (true (shen-f_error 'shen-read-char-h))))

(defun shen-typedf? (V817) (element? V817 (value 'shen-*signedfuncs*)))

(defun shen-sigf (V818) (concat 'shen-type-signature-of- V818))

(defun shen-placeholder () (gensym '&&))

(defun
 shen-base
 (V819 V820 V821 V822)
 (let
  Case
  (let
   V536
   (shen-lazyderef V820 V821)
   (if
    (= 'number V536)
    (do
     (shen-incinfs)
     (fwhen (number? (shen-lazyderef V819 V821)) V821 V822))
    (if
     (shen-pvar? V536)
     (do
      (shen-bindv V536 'number V821)
      (let
       Result
       (do
        (shen-incinfs)
        (fwhen (number? (shen-lazyderef V819 V821)) V821 V822))
       (do (shen-unbindv V536 V821) Result)))
     false)))
  (if
   (= Case false)
   (let
    Case
    (let
     V537
     (shen-lazyderef V820 V821)
     (if
      (= 'boolean V537)
      (do
       (shen-incinfs)
       (fwhen (boolean? (shen-lazyderef V819 V821)) V821 V822))
      (if
       (shen-pvar? V537)
       (do
        (shen-bindv V537 'boolean V821)
        (let
         Result
         (do
          (shen-incinfs)
          (fwhen (boolean? (shen-lazyderef V819 V821)) V821 V822))
         (do (shen-unbindv V537 V821) Result)))
       false)))
    (if
     (= Case false)
     (let
      Case
      (let
       V538
       (shen-lazyderef V820 V821)
       (if
        (= 'string V538)
        (do
         (shen-incinfs)
         (fwhen (string? (shen-lazyderef V819 V821)) V821 V822))
        (if
         (shen-pvar? V538)
         (do
          (shen-bindv V538 'string V821)
          (let
           Result
           (do
            (shen-incinfs)
            (fwhen (string? (shen-lazyderef V819 V821)) V821 V822))
           (do (shen-unbindv V538 V821) Result)))
         false)))
      (if
       (= Case false)
       (let
        Case
        (let
         V539
         (shen-lazyderef V820 V821)
         (if
          (= 'symbol V539)
          (do
           (shen-incinfs)
           (fwhen
            (symbol? (shen-lazyderef V819 V821))
            V821
            (freeze
             (fwhen
              (not (shen-placeholder? (shen-lazyderef V819 V821)))
              V821
              V822))))
          (if
           (shen-pvar? V539)
           (do
            (shen-bindv V539 'symbol V821)
            (let
             Result
             (do
              (shen-incinfs)
              (fwhen
               (symbol? (shen-lazyderef V819 V821))
               V821
               (freeze
                (fwhen
                 (not (shen-placeholder? (shen-lazyderef V819 V821)))
                 V821
                 V822))))
             (do (shen-unbindv V539 V821) Result)))
           false)))
        (if
         (= Case false)
         (let
          V540
          (shen-lazyderef V819 V821)
          (if
           (= () V540)
           (let
            V541
            (shen-lazyderef V820 V821)
            (if
             (cons? V541)
             (let
              V542
              (shen-lazyderef (hd V541) V821)
              (if
               (= 'list V542)
               (let
                V543
                (shen-lazyderef (tl V541) V821)
                (if
                 (cons? V543)
                 (let
                  A
                  (hd V543)
                  (let
                   V544
                   (shen-lazyderef (tl V543) V821)
                   (if
                    (= () V544)
                    (do (shen-incinfs) (thaw V822))
                    (if
                     (shen-pvar? V544)
                     (do
                      (shen-bindv V544 () V821)
                      (let
                       Result
                       (do (shen-incinfs) (thaw V822))
                       (do (shen-unbindv V544 V821) Result)))
                     false))))
                 (if
                  (shen-pvar? V543)
                  (let
                   A
                   (shen-newpv V821)
                   (do
                    (shen-bindv V543 (cons A ()) V821)
                    (let
                     Result
                     (do (shen-incinfs) (thaw V822))
                     (do (shen-unbindv V543 V821) Result))))
                  false)))
               (if
                (shen-pvar? V542)
                (do
                 (shen-bindv V542 'list V821)
                 (let
                  Result
                  (let
                   V545
                   (shen-lazyderef (tl V541) V821)
                   (if
                    (cons? V545)
                    (let
                     A
                     (hd V545)
                     (let
                      V546
                      (shen-lazyderef (tl V545) V821)
                      (if
                       (= () V546)
                       (do (shen-incinfs) (thaw V822))
                       (if
                        (shen-pvar? V546)
                        (do
                         (shen-bindv V546 () V821)
                         (let
                          Result
                          (do (shen-incinfs) (thaw V822))
                          (do (shen-unbindv V546 V821) Result)))
                        false))))
                    (if
                     (shen-pvar? V545)
                     (let
                      A
                      (shen-newpv V821)
                      (do
                       (shen-bindv V545 (cons A ()) V821)
                       (let
                        Result
                        (do (shen-incinfs) (thaw V822))
                        (do (shen-unbindv V545 V821) Result))))
                     false)))
                  (do (shen-unbindv V542 V821) Result)))
                false)))
             (if
              (shen-pvar? V541)
              (let
               A
               (shen-newpv V821)
               (do
                (shen-bindv V541 (cons 'list (cons A ())) V821)
                (let
                 Result
                 (do (shen-incinfs) (thaw V822))
                 (do (shen-unbindv V541 V821) Result))))
              false)))
           false))
         Case))
       Case))
     Case))
   Case)))

(defun
 shen-placeholder?
 (V823)
 (and (symbol? V823) (shen-placeholder-help? (str V823))))

(defun
 shen-placeholder-help?
 (V830)
 (cond
  ((and
    (shen-+string? V830)
    (and
     (= "&" (pos V830 0))
     (and (shen-+string? (tlstr V830)) (= "&" (pos (tlstr V830) 0)))))
   true)
  (true false)))

(defun
 shen-by_hypothesis
 (V831 V832 V833 V834 V835)
 (let
  Case
  (let
   V527
   (shen-lazyderef V833 V834)
   (if
    (cons? V527)
    (let
     V528
     (shen-lazyderef (hd V527) V834)
     (if
      (cons? V528)
      (let
       Y
       (hd V528)
       (let
        V529
        (shen-lazyderef (tl V528) V834)
        (if
         (cons? V529)
         (let
          V530
          (shen-lazyderef (hd V529) V834)
          (if
           (= (intern ":") V530)
           (let
            V531
            (shen-lazyderef (tl V529) V834)
            (if
             (cons? V531)
             (let
              B
              (hd V531)
              (let
               V532
               (shen-lazyderef (tl V531) V834)
               (if
                (= () V532)
                (do
                 (shen-incinfs)
                 (identical
                  V831
                  Y
                  V834
                  (freeze (unify! V832 B V834 V835))))
                false)))
             false))
           false))
         false)))
      false))
    false))
  (if
   (= Case false)
   (let
    V533
    (shen-lazyderef V833 V834)
    (if
     (cons? V533)
     (let
      Hyp
      (tl V533)
      (do (shen-incinfs) (recur V831 V832 Hyp V834 V835)))
     false))
   Case)))

(defun
 shen-t*-kl_def
 (V836 V837 V838 V839 V840)
 (let
  Throwcontrol
  (shen-catchpoint)
  (shen-cutpoint
   Throwcontrol
   (let
    V521
    (shen-lazyderef V836 V839)
    (if
     (cons? V521)
     (let
      V522
      (shen-lazyderef (hd V521) V839)
      (if
       (= 'define V522)
       (let
        V523
        (shen-lazyderef (tl V521) V839)
        (if
         (cons? V523)
         (let
          F
          (hd V523)
          (let
           X
           (tl V523)
           (let
            Error
            (shen-newpv V839)
            (let
             Sig+Rules
             (shen-newpv V839)
             (let
              Vars
              (shen-newpv V839)
              (let
               Rules
               (shen-newpv V839)
               (let
                Sig&&
                (shen-newpv V839)
                (let
                 Declare
                 (shen-newpv V839)
                 (let
                  Sig
                  (shen-newpv V839)
                  (do
                   (shen-incinfs)
                   (bind
                    Sig+Rules
                    (compile
                     (lambda X (shen-<sig+rules> X))
                     (shen-lazyderef X V839)
                     ())
                    V839
                    (freeze
                     (bind
                      Error
                      (if
                       (= (shen-lazyderef Sig+Rules V839) (fail))
                       (shen-errordef (shen-lazyderef F V839))
                       'shen-skip)
                      V839
                      (freeze
                       (bind
                        Sig
                        (hd (shen-lazyderef Sig+Rules V839))
                        V839
                        (freeze
                         (bind
                          Rules
                          (tl (shen-lazyderef Sig+Rules V839))
                          V839
                          (freeze
                           (bind
                            Vars
                            (shen-extract_vars
                             (shen-lazyderef Sig V839))
                            V839
                            (freeze
                             (bind
                              Sig&&
                              (shen-placeholders
                               (shen-lazyderef Sig V839)
                               (shen-lazyderef Vars V839))
                              V839
                              (freeze
                               (cut
                                Throwcontrol
                                V839
                                (freeze
                                 (shen-t*-rules
                                  Rules
                                  Sig&&
                                  1
                                  F
                                  (cons
                                   (cons
                                    F
                                    (cons
                                     (intern ":")
                                     (cons Sig&& ())))
                                   V838)
                                  V839
                                  (freeze
                                   (bind
                                    Declare
                                    (declare
                                     (shen-lazyderef F V839)
                                     (shen-lazyderef Sig V839))
                                    V839
                                    (freeze
                                     (unify!
                                      V837
                                      Sig
                                      V839
                                      V840)))))))))))))))))))))))))))))
         false))
       false))
     false)))))

(defun
 shen-<sig+rules>
 (V845)
 (let
  Result
  (let
   Parse_<signature>
   (shen-<signature> V845)
   (if
    (not (= (fail) Parse_<signature>))
    (let
     Parse_<trules>
     (shen-<trules> Parse_<signature>)
     (if
      (not (= (fail) Parse_<trules>))
      (shen-reassemble
       (fst Parse_<trules>)
       (cons (snd Parse_<signature>) (snd Parse_<trules>)))
      (fail)))
    (fail)))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-placeholders
 (V850 V851)
 (cond
  ((cons? V850) (map (lambda Z (shen-placeholders Z V851)) V850))
  ((element? V850 V851) (concat '&& V850))
  (true V850)))

(defun
 shen-<trules>
 (V856)
 (let
  Result
  (let
   Parse_<trule>
   (shen-<trule> V856)
   (if
    (not (= (fail) Parse_<trule>))
    (let
     Parse_<trules>
     (shen-<trules> Parse_<trule>)
     (if
      (not (= (fail) Parse_<trules>))
      (shen-reassemble
       (fst Parse_<trules>)
       (cons (snd Parse_<trule>) (snd Parse_<trules>)))
      (fail)))
    (fail)))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<trule>
     (shen-<trule> V856)
     (if
      (not (= (fail) Parse_<trule>))
      (shen-reassemble
       (fst Parse_<trule>)
       (cons (snd Parse_<trule>) ()))
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<trule>
 (V861)
 (let
  Result
  (let
   Parse_<patterns>
   (shen-<patterns> V861)
   (if
    (not (= (fail) Parse_<patterns>))
    (let
     Parse_<arrow>
     (shen-<arrow> Parse_<patterns>)
     (if
      (not (= (fail) Parse_<arrow>))
      (let
       Parse_<action>
       (shen-<action> Parse_<arrow>)
       (if
        (not (= (fail) Parse_<action>))
        (let
         Parse_<guard?>
         (shen-<guard?> Parse_<action>)
         (if
          (not (= (fail) Parse_<guard?>))
          (shen-reassemble
           (fst Parse_<guard?>)
           (let
            Vars
            (shen-extract_vars (snd Parse_<patterns>))
            (let
             Patterns
             (shen-placeholders (snd Parse_<patterns>) Vars)
             (let
              Action
              (shen-placeholders
               (shen-curry (snd Parse_<action>))
               Vars)
              (let
               Guard
               (shen-placeholders
                (shen-curry (snd Parse_<guard?>))
                Vars)
               (shen-form-rule
                Patterns
                (snd Parse_<arrow>)
                Action
                Guard))))))
          (fail)))
        (fail)))
      (fail)))
    (fail)))
  (if (= Result (fail)) (fail) Result)))

(defun
 shen-form-rule
 (V862 V863 V864 V865)
 (cond
  ((= 'shen-forward V863)
   (cons
    V862
    (cons
     (if
      (= V865 'shen-skip)
      V864
      (cons 'where (cons V865 (cons V864 ()))))
     ())))
  ((and
    (= 'shen-backward V863)
    (and
     (cons? V864)
     (and
      (cons? (hd V864))
      (and
       (= 'fail-if (hd (hd V864)))
       (and
        (cons? (tl (hd V864)))
        (and
         (= () (tl (tl (hd V864))))
         (and (cons? (tl V864)) (= () (tl (tl V864))))))))))
   (cons
    V862
    (cons
     (if
      (= V865 'shen-skip)
      (cons
       'where
       (cons
        (cons 'not (cons (cons (hd (tl (hd V864))) (tl V864)) ()))
        (tl V864)))
      (cons
       'where
       (cons
        (cons
         (cons 'and (cons V865 ()))
         (cons
          (cons 'not (cons (cons (hd (tl (hd V864))) (tl V864)) ()))
          ()))
        (tl V864))))
     ())))
  ((= 'shen-backward V863)
   (cons
    V862
    (cons
     (if
      (= V865 'shen-skip)
      (cons
       'where
       (cons
        (cons
         'not
         (cons
          (cons (cons '== (cons V864 ())) (cons (cons 'fail ()) ()))
          ()))
        (cons V864 ())))
      (cons
       'where
       (cons
        (cons
         (cons 'and (cons V865 ()))
         (cons
          (cons
           'not
           (cons
            (cons (cons '== (cons V864 ())) (cons (cons 'fail ()) ()))
            ()))
          ()))
        (cons V864 ()))))
     ())))
  (true (shen-f_error 'shen-form-rule))))

(defun
 shen-<guard?>
 (V870)
 (let
  Result
  (if
   (and (cons? (fst V870)) (= 'where (hd (fst V870))))
   (let
    Parse_<guard>
    (shen-<guard> (shen-reassemble (tl (fst V870)) (snd V870)))
    (if
     (not (= (fail) Parse_<guard>))
     (shen-reassemble (fst Parse_<guard>) (snd Parse_<guard>))
     (fail)))
   (fail))
  (if
   (= Result (fail))
   (let
    Result
    (let
     Parse_<e>
     (<e> V870)
     (if
      (not (= (fail) Parse_<e>))
      (shen-reassemble (fst Parse_<e>) 'shen-skip)
      (fail)))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-<arrow>
 (V875)
 (let
  Result
  (if
   (and (cons? (fst V875)) (= '-> (hd (fst V875))))
   (shen-reassemble
    (fst (shen-reassemble (tl (fst V875)) (snd V875)))
    'shen-forward)
   (fail))
  (if
   (= Result (fail))
   (let
    Result
    (if
     (and (cons? (fst V875)) (= '<- (hd (fst V875))))
     (shen-reassemble
      (fst (shen-reassemble (tl (fst V875)) (snd V875)))
      'shen-backward)
     (fail))
    (if (= Result (fail)) (fail) Result))
   Result)))

(defun
 shen-errordef
 (V876)
 (interror "syntax error in ~A~%" (__at__p V876 ())))

(defun
 shen-t*-rules
 (V877 V878 V879 V880 V881 V882 V883)
 (let
  Throwcontrol
  (shen-catchpoint)
  (shen-cutpoint
   Throwcontrol
   (let
    Case
    (let
     V516
     (shen-lazyderef V877 V882)
     (if (= () V516) (do (shen-incinfs) (thaw V883)) false))
    (if
     (= Case false)
     (let
      V517
      (shen-lazyderef V877 V882)
      (if
       (cons? V517)
       (let
        Rule
        (hd V517)
        (let
         Rules
         (tl V517)
         (let
          M
          (shen-newpv V882)
          (do
           (shen-incinfs)
           (shen-t*-rule
            Rule
            V878
            V879
            V880
            V881
            V882
            (freeze
             (cut
              Throwcontrol
              V882
              (freeze
               (bind
                M
                (+ (shen-lazyderef V879 V882) 1)
                V882
                (freeze
                 (shen-t*-rules
                  Rules
                  V878
                  M
                  V880
                  V881
                  V882
                  V883)))))))))))
       false))
     Case)))))

(defun
 shen-t*-rule
 (V884 V885 V886 V887 V888 V889 V890)
 (let
  Case
  (do (shen-incinfs) (shen-t*-ruleh V884 V885 V888 V889 V890))
  (if
   (= Case false)
   (let
    Error
    (shen-newpv V889)
    (do
     (shen-incinfs)
     (bind
      Error
      (shen-type-insecure-rule-error-message
       (shen-lazyderef V886 V889)
       (shen-lazyderef V887 V889))
      V889
      V890)))
   Case)))

(defun
 shen-t*-ruleh
 (V891 V892 V893 V894 V895)
 (let
  Throwcontrol
  (shen-catchpoint)
  (shen-cutpoint
   Throwcontrol
   (let
    V503
    (shen-lazyderef V891 V894)
    (if
     (cons? V503)
     (let
      Patterns
      (hd V503)
      (let
       V504
       (shen-lazyderef (tl V503) V894)
       (if
        (cons? V504)
        (let
         Result
         (hd V504)
         (let
          V505
          (shen-lazyderef (tl V504) V894)
          (if
           (= () V505)
           (let
            NewHyp
            (shen-newpv V894)
            (let
             B
             (shen-newpv V894)
             (let
              AllHyp
              (shen-newpv V894)
              (do
               (shen-incinfs)
               (shen-t*-patterns
                Patterns
                V892
                NewHyp
                B
                V894
                (freeze
                 (cut
                  Throwcontrol
                  V894
                  (freeze
                   (shen-conc
                    NewHyp
                    V893
                    AllHyp
                    V894
                    (freeze
                     (cut
                      Throwcontrol
                      V894
                      (freeze
                       (shen-th* Result B AllHyp V894 V895)))))))))))))
           false)))
        false)))
     false)))))

(defun
 shen-type-insecure-rule-error-message
 (V896 V897)
 (interror
  "type error in rule ~A of ~A~%"
  (__at__p V896 (__at__p V897 ()))))

(defun
 shen-t*-patterns
 (V898 V899 V900 V901 V902 V903)
 (let
  Throwcontrol
  (shen-catchpoint)
  (shen-cutpoint
   Throwcontrol
   (let
    Case
    (let
     V484
     (shen-lazyderef V898 V902)
     (if
      (= () V484)
      (let
       V485
       (shen-lazyderef V900 V902)
       (if
        (= () V485)
        (do (shen-incinfs) (unify! V901 V899 V902 V903))
        (if
         (shen-pvar? V485)
         (do
          (shen-bindv V485 () V902)
          (let
           Result
           (do (shen-incinfs) (unify! V901 V899 V902 V903))
           (do (shen-unbindv V485 V902) Result)))
         false)))
      false))
    (if
     (= Case false)
     (let
      V486
      (shen-lazyderef V898 V902)
      (if
       (cons? V486)
       (let
        Pattern478
        (hd V486)
        (let
         Patterns
         (tl V486)
         (let
          V487
          (shen-lazyderef V899 V902)
          (if
           (cons? V487)
           (let
            A479
            (hd V487)
            (let
             V488
             (shen-lazyderef (tl V487) V902)
             (if
              (cons? V488)
              (let
               V489
               (shen-lazyderef (hd V488) V902)
               (if
                (= '--> V489)
                (let
                 V490
                 (shen-lazyderef (tl V488) V902)
                 (if
                  (cons? V490)
                  (let
                   B
                   (hd V490)
                   (let
                    V491
                    (shen-lazyderef (tl V490) V902)
                    (if
                     (= () V491)
                     (let
                      V492
                      (shen-lazyderef V900 V902)
                      (if
                       (cons? V492)
                       (let
                        V493
                        (shen-lazyderef (hd V492) V902)
                        (if
                         (cons? V493)
                         (let
                          Pattern
                          (hd V493)
                          (let
                           V494
                           (shen-lazyderef (tl V493) V902)
                           (if
                            (cons? V494)
                            (let
                             V495
                             (shen-lazyderef (hd V494) V902)
                             (if
                              (= (intern ":") V495)
                              (let
                               V496
                               (shen-lazyderef (tl V494) V902)
                               (if
                                (cons? V496)
                                (let
                                 A
                                 (hd V496)
                                 (let
                                  V497
                                  (shen-lazyderef (tl V496) V902)
                                  (if
                                   (= () V497)
                                   (let
                                    Hyp
                                    (tl V492)
                                    (let
                                     Assume
                                     (shen-newpv V902)
                                     (do
                                      (shen-incinfs)
                                      (unify!
                                       A
                                       A479
                                       V902
                                       (freeze
                                        (unify!
                                         Pattern
                                         Pattern478
                                         V902
                                         (freeze
                                          (shen-t*-assume
                                           Pattern
                                           Assume
                                           V902
                                           (freeze
                                            (cut
                                             Throwcontrol
                                             V902
                                             (freeze
                                              (shen-th*
                                               Pattern
                                               A
                                               Assume
                                               V902
                                               (freeze
                                                (cut
                                                 Throwcontrol
                                                 V902
                                                 (freeze
                                                  (shen-t*-patterns
                                                   Patterns
                                                   B
                                                   Hyp
                                                   V901
                                                   V902
                                                   V903))))))))))))))))
                                   (if
                                    (shen-pvar? V497)
                                    (do
                                     (shen-bindv V497 () V902)
                                     (let
                                      Result
                                      (let
                                       Hyp
                                       (tl V492)
                                       (let
                                        Assume
                                        (shen-newpv V902)
                                        (do
                                         (shen-incinfs)
                                         (unify!
                                          A
                                          A479
                                          V902
                                          (freeze
                                           (unify!
                                            Pattern
                                            Pattern478
                                            V902
                                            (freeze
                                             (shen-t*-assume
                                              Pattern
                                              Assume
                                              V902
                                              (freeze
                                               (cut
                                                Throwcontrol
                                                V902
                                                (freeze
                                                 (shen-th*
                                                  Pattern
                                                  A
                                                  Assume
                                                  V902
                                                  (freeze
                                                   (cut
                                                    Throwcontrol
                                                    V902
                                                    (freeze
                                                     (shen-t*-patterns
                                                      Patterns
                                                      B
                                                      Hyp
                                                      V901
                                                      V902
                                                      V903))))))))))))))))
                                      (do
                                       (shen-unbindv V497 V902)
                                       Result)))
                                    false))))
                                (if
                                 (shen-pvar? V496)
                                 (let
                                  A
                                  (shen-newpv V902)
                                  (do
                                   (shen-bindv V496 (cons A ()) V902)
                                   (let
                                    Result
                                    (let
                                     Hyp
                                     (tl V492)
                                     (let
                                      Assume
                                      (shen-newpv V902)
                                      (do
                                       (shen-incinfs)
                                       (unify!
                                        A
                                        A479
                                        V902
                                        (freeze
                                         (unify!
                                          Pattern
                                          Pattern478
                                          V902
                                          (freeze
                                           (shen-t*-assume
                                            Pattern
                                            Assume
                                            V902
                                            (freeze
                                             (cut
                                              Throwcontrol
                                              V902
                                              (freeze
                                               (shen-th*
                                                Pattern
                                                A
                                                Assume
                                                V902
                                                (freeze
                                                 (cut
                                                  Throwcontrol
                                                  V902
                                                  (freeze
                                                   (shen-t*-patterns
                                                    Patterns
                                                    B
                                                    Hyp
                                                    V901
                                                    V902
                                                    V903))))))))))))))))
                                    (do
                                     (shen-unbindv V496 V902)
                                     Result))))
                                 false)))
                              (if
                               (shen-pvar? V495)
                               (do
                                (shen-bindv V495 (intern ":") V902)
                                (let
                                 Result
                                 (let
                                  V498
                                  (shen-lazyderef (tl V494) V902)
                                  (if
                                   (cons? V498)
                                   (let
                                    A
                                    (hd V498)
                                    (let
                                     V499
                                     (shen-lazyderef (tl V498) V902)
                                     (if
                                      (= () V499)
                                      (let
                                       Hyp
                                       (tl V492)
                                       (let
                                        Assume
                                        (shen-newpv V902)
                                        (do
                                         (shen-incinfs)
                                         (unify!
                                          A
                                          A479
                                          V902
                                          (freeze
                                           (unify!
                                            Pattern
                                            Pattern478
                                            V902
                                            (freeze
                                             (shen-t*-assume
                                              Pattern
                                              Assume
                                              V902
                                              (freeze
                                               (cut
                                                Throwcontrol
                                                V902
                                                (freeze
                                                 (shen-th*
                                                  Pattern
                                                  A
                                                  Assume
                                                  V902
                                                  (freeze
                                                   (cut
                                                    Throwcontrol
                                                    V902
                                                    (freeze
                                                     (shen-t*-patterns
                                                      Patterns
                                                      B
                                                      Hyp
                                                      V901
                                                      V902
                                                      V903))))))))))))))))
                                      (if
                                       (shen-pvar? V499)
                                       (do
                                        (shen-bindv V499 () V902)
                                        (let
                                         Result
                                         (let
                                          Hyp
                                          (tl V492)
                                          (let
                                           Assume
                                           (shen-newpv V902)
                                           (do
                                            (shen-incinfs)
                                            (unify!
                                             A
                                             A479
                                             V902
                                             (freeze
                                              (unify!
                                               Pattern
                                               Pattern478
                                               V902
                                               (freeze
                                                (shen-t*-assume
                                                 Pattern
                                                 Assume
                                                 V902
                                                 (freeze
                                                  (cut
                                                   Throwcontrol
                                                   V902
                                                   (freeze
                                                    (shen-th*
                                                     Pattern
                                                     A
                                                     Assume
                                                     V902
                                                     (freeze
                                                      (cut
                                                       Throwcontrol
                                                       V902
                                                       (freeze
                                                        (shen-t*-patterns
                                                         Patterns
                                                         B
                                                         Hyp
                                                         V901
                                                         V902
                                                         V903))))))))))))))))
                                         (do
                                          (shen-unbindv V499 V902)
                                          Result)))
                                       false))))
                                   (if
                                    (shen-pvar? V498)
                                    (let
                                     A
                                     (shen-newpv V902)
                                     (do
                                      (shen-bindv
                                       V498
                                       (cons A ())
                                       V902)
                                      (let
                                       Result
                                       (let
                                        Hyp
                                        (tl V492)
                                        (let
                                         Assume
                                         (shen-newpv V902)
                                         (do
                                          (shen-incinfs)
                                          (unify!
                                           A
                                           A479
                                           V902
                                           (freeze
                                            (unify!
                                             Pattern
                                             Pattern478
                                             V902
                                             (freeze
                                              (shen-t*-assume
                                               Pattern
                                               Assume
                                               V902
                                               (freeze
                                                (cut
                                                 Throwcontrol
                                                 V902
                                                 (freeze
                                                  (shen-th*
                                                   Pattern
                                                   A
                                                   Assume
                                                   V902
                                                   (freeze
                                                    (cut
                                                     Throwcontrol
                                                     V902
                                                     (freeze
                                                      (shen-t*-patterns
                                                       Patterns
                                                       B
                                                       Hyp
                                                       V901
                                                       V902
                                                       V903))))))))))))))))
                                       (do
                                        (shen-unbindv V498 V902)
                                        Result))))
                                    false)))
                                 (do (shen-unbindv V495 V902) Result)))
                               false)))
                            (if
                             (shen-pvar? V494)
                             (let
                              A
                              (shen-newpv V902)
                              (do
                               (shen-bindv
                                V494
                                (cons (intern ":") (cons A ()))
                                V902)
                               (let
                                Result
                                (let
                                 Hyp
                                 (tl V492)
                                 (let
                                  Assume
                                  (shen-newpv V902)
                                  (do
                                   (shen-incinfs)
                                   (unify!
                                    A
                                    A479
                                    V902
                                    (freeze
                                     (unify!
                                      Pattern
                                      Pattern478
                                      V902
                                      (freeze
                                       (shen-t*-assume
                                        Pattern
                                        Assume
                                        V902
                                        (freeze
                                         (cut
                                          Throwcontrol
                                          V902
                                          (freeze
                                           (shen-th*
                                            Pattern
                                            A
                                            Assume
                                            V902
                                            (freeze
                                             (cut
                                              Throwcontrol
                                              V902
                                              (freeze
                                               (shen-t*-patterns
                                                Patterns
                                                B
                                                Hyp
                                                V901
                                                V902
                                                V903))))))))))))))))
                                (do (shen-unbindv V494 V902) Result))))
                             false))))
                         (if
                          (shen-pvar? V493)
                          (let
                           Pattern
                           (shen-newpv V902)
                           (let
                            A
                            (shen-newpv V902)
                            (do
                             (shen-bindv
                              V493
                              (cons
                               Pattern
                               (cons (intern ":") (cons A ())))
                              V902)
                             (let
                              Result
                              (let
                               Hyp
                               (tl V492)
                               (let
                                Assume
                                (shen-newpv V902)
                                (do
                                 (shen-incinfs)
                                 (unify!
                                  A
                                  A479
                                  V902
                                  (freeze
                                   (unify!
                                    Pattern
                                    Pattern478
                                    V902
                                    (freeze
                                     (shen-t*-assume
                                      Pattern
                                      Assume
                                      V902
                                      (freeze
                                       (cut
                                        Throwcontrol
                                        V902
                                        (freeze
                                         (shen-th*
                                          Pattern
                                          A
                                          Assume
                                          V902
                                          (freeze
                                           (cut
                                            Throwcontrol
                                            V902
                                            (freeze
                                             (shen-t*-patterns
                                              Patterns
                                              B
                                              Hyp
                                              V901
                                              V902
                                              V903))))))))))))))))
                              (do (shen-unbindv V493 V902) Result)))))
                          false)))
                       (if
                        (shen-pvar? V492)
                        (let
                         Pattern
                         (shen-newpv V902)
                         (let
                          A
                          (shen-newpv V902)
                          (let
                           Hyp
                           (shen-newpv V902)
                           (do
                            (shen-bindv
                             V492
                             (cons
                              (cons
                               Pattern
                               (cons (intern ":") (cons A ())))
                              Hyp)
                             V902)
                            (let
                             Result
                             (let
                              Assume
                              (shen-newpv V902)
                              (do
                               (shen-incinfs)
                               (unify!
                                A
                                A479
                                V902
                                (freeze
                                 (unify!
                                  Pattern
                                  Pattern478
                                  V902
                                  (freeze
                                   (shen-t*-assume
                                    Pattern
                                    Assume
                                    V902
                                    (freeze
                                     (cut
                                      Throwcontrol
                                      V902
                                      (freeze
                                       (shen-th*
                                        Pattern
                                        A
                                        Assume
                                        V902
                                        (freeze
                                         (cut
                                          Throwcontrol
                                          V902
                                          (freeze
                                           (shen-t*-patterns
                                            Patterns
                                            B
                                            Hyp
                                            V901
                                            V902
                                            V903)))))))))))))))
                             (do (shen-unbindv V492 V902) Result))))))
                        false)))
                     false)))
                  false))
                false))
              false)))
           false))))
       false))
     Case)))))

(defun
 shen-t*-assume
 (V904 V905 V906 V907)
 (let
  Throwcontrol
  (shen-catchpoint)
  (shen-cutpoint
   Throwcontrol
   (let
    Case
    (let
     V475
     (shen-lazyderef V904 V906)
     (if
      (cons? V475)
      (let
       X
       (hd V475)
       (let
        Y
        (tl V475)
        (let
         A1
         (shen-newpv V906)
         (let
          A2
          (shen-newpv V906)
          (do
           (shen-incinfs)
           (cut
            Throwcontrol
            V906
            (freeze
             (shen-t*-assume
              X
              A1
              V906
              (freeze
               (shen-t*-assume
                Y
                A2
                V906
                (freeze
                 (bind
                  V905
                  (append
                   (shen-lazyderef A1 V906)
                   (shen-lazyderef A2 V906))
                  V906
                  V907))))))))))))
      false))
    (if
     (= Case false)
     (let
      Case
      (let
       A
       (shen-newpv V906)
       (do
        (shen-incinfs)
        (fwhen
         (shen-placeholder? (shen-lazyderef V904 V906))
         V906
         (freeze
          (bind
           V905
           (cons
            (cons
             (shen-lazyderef V904 V906)
             (cons (intern ":") (cons (shen-lazyderef A V906) ())))
            ())
           V906
           V907)))))
      (if
       (= Case false)
       (let
        V476
        (shen-lazyderef V905 V906)
        (if
         (= () V476)
         (do (shen-incinfs) (thaw V907))
         (if
          (shen-pvar? V476)
          (do
           (shen-bindv V476 () V906)
           (let
            Result
            (do (shen-incinfs) (thaw V907))
            (do (shen-unbindv V476 V906) Result)))
          false)))
       Case))
     Case)))))

(defun
 shen-conc
 (V908 V909 V910 V911 V912)
 (let
  Case
  (let
   V471
   (shen-lazyderef V908 V911)
   (if
    (= () V471)
    (do
     (shen-incinfs)
     (bind V910 (shen-lazyderef V909 V911) V911 V912))
    false))
  (if
   (= Case false)
   (let
    V472
    (shen-lazyderef V908 V911)
    (if
     (cons? V472)
     (let
      X
      (hd V472)
      (let
       Y
       (tl V472)
       (let
        Z
        (shen-newpv V911)
        (do
         (shen-incinfs)
         (bind
          V910
          (cons (shen-lazyderef X V911) (shen-lazyderef Z V911))
          V911
          (freeze (shen-conc Y V909 Z V911 V912)))))))
     false))
   Case)))

(defun
 shen-findallhelp
 (V913 V914 V915 V916 V917 V918)
 (let
  Case
  (do
   (shen-incinfs)
   (call
    V914
    V917
    (freeze
     (shen-remember V916 V913 V917 (freeze (fwhen false V917 V918))))))
  (if
   (= Case false)
   (do
    (shen-incinfs)
    (bind V915 (value (shen-lazyderef V916 V917)) V917 V918))
   Case)))

(defun
 shen-remember
 (V919 V920 V921 V922)
 (let
  B
  (shen-newpv V921)
  (do
   (shen-incinfs)
   (bind
    B
    (set
     (shen-deref V919 V921)
     (cons (shen-deref V920 V921) (value (shen-deref V919 V921))))
    V921
    V922))))

(defun
 findall
 (V923 V924 V925 V926 V927)
 (let
  B
  (shen-newpv V926)
  (let
   A
   (shen-newpv V926)
   (do
    (shen-incinfs)
    (bind
     A
     (gensym 'a)
     V926
     (freeze
      (bind
       B
       (set (shen-lazyderef A V926) ())
       V926
       (freeze (shen-findallhelp V923 V924 V925 A V926 V927)))))))))

(defun
 shen-findallhelp
 (V913 V914 V915 V916 V917 V918)
 (let
  Case
  (do
   (shen-incinfs)
   (call
    V914
    V917
    (freeze
     (shen-remember V916 V913 V917 (freeze (fwhen false V917 V918))))))
  (if
   (= Case false)
   (do
    (shen-incinfs)
    (bind V915 (value (shen-lazyderef V916 V917)) V917 V918))
   Case)))

(defun
 shen-remember
 (V919 V920 V921 V922)
 (let
  B
  (shen-newpv V921)
  (do
   (shen-incinfs)
   (bind
    B
    (set
     (shen-deref V919 V921)
     (cons (shen-deref V920 V921) (value (shen-deref V919 V921))))
    V921
    V922))))

(clojure.core/comment "klambda/printer.kl")

(defun
 shen-sys-print
 (V461)
 (cond
  ((= "" V461) "")
  ((and
    (shen-+string? V461)
    (and
     (= "_" (pos V461 0))
     (and
      (shen-+string? (tlstr V461))
      (and
       (= "q" (pos (tlstr V461) 0))
       (and
        (shen-+string? (tlstr (tlstr V461)))
        (and
         (= "u" (pos (tlstr (tlstr V461)) 0))
         (and
          (shen-+string? (tlstr (tlstr (tlstr V461))))
          (and
           (= "o" (pos (tlstr (tlstr (tlstr V461))) 0))
           (and
            (shen-+string? (tlstr (tlstr (tlstr (tlstr V461)))))
            (and
             (= "t" (pos (tlstr (tlstr (tlstr (tlstr V461)))) 0))
             (and
              (shen-+string?
               (tlstr (tlstr (tlstr (tlstr (tlstr V461))))))
              (=
               "e"
               (pos
                (tlstr (tlstr (tlstr (tlstr (tlstr V461)))))
                0)))))))))))))
   (__at__s
    "'"
    (shen-sys-print
     (tlstr (tlstr (tlstr (tlstr (tlstr (tlstr V461)))))))))
  ((and
    (shen-+string? V461)
    (and
     (= "_" (pos V461 0))
     (and
      (shen-+string? (tlstr V461))
      (and
       (= "b" (pos (tlstr V461) 0))
       (and
        (shen-+string? (tlstr (tlstr V461)))
        (and
         (= "a" (pos (tlstr (tlstr V461)) 0))
         (and
          (shen-+string? (tlstr (tlstr (tlstr V461))))
          (and
           (= "c" (pos (tlstr (tlstr (tlstr V461))) 0))
           (and
            (shen-+string? (tlstr (tlstr (tlstr (tlstr V461)))))
            (and
             (= "k" (pos (tlstr (tlstr (tlstr (tlstr V461)))) 0))
             (and
              (shen-+string?
               (tlstr (tlstr (tlstr (tlstr (tlstr V461))))))
              (and
               (=
                "q"
                (pos (tlstr (tlstr (tlstr (tlstr (tlstr V461))))) 0))
               (and
                (shen-+string?
                 (tlstr (tlstr (tlstr (tlstr (tlstr (tlstr V461)))))))
                (and
                 (=
                  "u"
                  (pos
                   (tlstr (tlstr (tlstr (tlstr (tlstr (tlstr V461))))))
                   0))
                 (and
                  (shen-+string?
                   (tlstr
                    (tlstr
                     (tlstr (tlstr (tlstr (tlstr (tlstr V461))))))))
                  (and
                   (=
                    "o"
                    (pos
                     (tlstr
                      (tlstr
                       (tlstr (tlstr (tlstr (tlstr (tlstr V461)))))))
                     0))
                   (and
                    (shen-+string?
                     (tlstr
                      (tlstr
                       (tlstr
                        (tlstr
                         (tlstr (tlstr (tlstr (tlstr V461)))))))))
                    (and
                     (=
                      "t"
                      (pos
                       (tlstr
                        (tlstr
                         (tlstr
                          (tlstr
                           (tlstr (tlstr (tlstr (tlstr V461))))))))
                       0))
                     (and
                      (shen-+string?
                       (tlstr
                        (tlstr
                         (tlstr
                          (tlstr
                           (tlstr
                            (tlstr (tlstr (tlstr (tlstr V461))))))))))
                      (=
                       "e"
                       (pos
                        (tlstr
                         (tlstr
                          (tlstr
                           (tlstr
                            (tlstr
                             (tlstr (tlstr (tlstr (tlstr V461)))))))))
                        0)))))))))))))))))))))
   (__at__s
    "`"
    (shen-sys-print
     (tlstr
      (tlstr
       (tlstr
        (tlstr
         (tlstr (tlstr (tlstr (tlstr (tlstr (tlstr V461)))))))))))))
  ((and
    (shen-+string? V461)
    (and
     (= "_" (pos V461 0))
     (and
      (shen-+string? (tlstr V461))
      (and
       (= "h" (pos (tlstr V461) 0))
       (and
        (shen-+string? (tlstr (tlstr V461)))
        (and
         (= "a" (pos (tlstr (tlstr V461)) 0))
         (and
          (shen-+string? (tlstr (tlstr (tlstr V461))))
          (and
           (= "s" (pos (tlstr (tlstr (tlstr V461))) 0))
           (and
            (shen-+string? (tlstr (tlstr (tlstr (tlstr V461)))))
            (=
             "h"
             (pos (tlstr (tlstr (tlstr (tlstr V461)))) 0)))))))))))
   (__at__s
    "#"
    (shen-sys-print (tlstr (tlstr (tlstr (tlstr (tlstr V461))))))))
  ((and
    (shen-+string? V461)
    (and
     (= "|" (pos V461 0))
     (and
      (shen-+string? (tlstr V461))
      (and
       (= ":" (pos (tlstr V461) 0))
       (and
        (shen-+string? (tlstr (tlstr V461)))
        (= "|" (pos (tlstr (tlstr V461)) 0)))))))
   (__at__s ":" (shen-sys-print (tlstr (tlstr (tlstr V461))))))
  ((and
    (shen-+string? V461)
    (and
     (= "|" (pos V461 0))
     (and
      (shen-+string? (tlstr V461))
      (and
       (= ";" (pos (tlstr V461) 0))
       (and
        (shen-+string? (tlstr (tlstr V461)))
        (= "|" (pos (tlstr (tlstr V461)) 0)))))))
   (__at__s ";" (shen-sys-print (tlstr (tlstr (tlstr V461))))))
  ((and
    (shen-+string? V461)
    (and
     (= "|" (pos V461 0))
     (and
      (shen-+string? (tlstr V461))
      (and
       (= "," (pos (tlstr V461) 0))
       (and
        (shen-+string? (tlstr (tlstr V461)))
        (= "|" (pos (tlstr (tlstr V461)) 0)))))))
   (__at__s "," (shen-sys-print (tlstr (tlstr (tlstr V461))))))
  ((shen-+string? V461)
   (__at__s (pos V461 0) (shen-sys-print (tlstr V461))))
  (true (shen-f_error 'shen-sys-print))))

(clojure.core/comment "klambda/yacc.kl")

(defun
 shen-yacc
 (V293)
 (cond
  ((and (cons? V293) (and (= 'defcc (hd V293)) (cons? (tl V293))))
   (shen-yacc->shen (hd (tl V293)) (tl (tl V293))))
  (true (shen-sys-error 'shen-yacc))))

(defun
 shen-yacc->shen
 (V294 V295)
 (cons
  'define
  (cons
   V294
   (shen-yacc_cases
    (map
     (lambda V296 (shen-cc_body V296))
     (shen-split_cc_rules V295 ()))))))

(defun
 shen-yacc_cases
 (V297)
 (append
  (mapcan (lambda Case (cons 'Stream (cons '<- (cons Case ())))) V297)
  (cons '_ (cons '-> (cons (cons 'fail ()) ())))))

(defun
 shen-first_n
 (V302 V303)
 (cond
  ((= 0 V302) ())
  ((= () V303) ())
  ((cons? V303) (cons (hd V303) (shen-first_n (- V302 1) (tl V303))))
  (true (shen-sys-error 'shen-first_n))))

(defun
 shen-split_cc_rules
 (V304 V305)
 (cond
  ((and (= () V304) (= () V305)) ())
  ((= () V304) (cons (shen-split_cc_rule (reverse V305) ()) ()))
  ((and (cons? V304) (= (intern ";") (hd V304)))
   (cons
    (shen-split_cc_rule (reverse V305) ())
    (shen-split_cc_rules (tl V304) ())))
  ((cons? V304) (recur (tl V304) (cons (hd V304) V305)))
  (true (shen-sys-error 'shen-split_cc_rules))))

(defun
 shen-split_cc_rule
 (V306 V307)
 (cond
  ((and
    (cons? V306)
    (and
     (= (intern ":=") (hd V306))
     (and (cons? (tl V306)) (= () (tl (tl V306))))))
   (cons (reverse V307) (tl V306)))
  ((and (cons? V306) (= (intern ":=") (hd V306)))
   (cons (reverse V307) (cons (shen-cons_form (tl V306)) ())))
  ((= () V306)
   (do
    (intoutput "warning: " ())
    (do
     (map (lambda X (intoutput "~A " (__at__p X ()))) (reverse V307))
     (do
      (intoutput "has no semantics.~%" ())
      (shen-split_cc_rule
       (cons
        (intern ":=")
        (cons (shen-default_semantics (reverse V307)) ()))
       V307)))))
  ((cons? V306) (recur (tl V306) (cons (hd V306) V307)))
  (true (shen-sys-error 'shen-split_cc_rule))))

(defun
 shen-default_semantics
 (V308)
 (cond
  ((= () V308) ())
  ((and (cons? V308) (shen-grammar_symbol? (hd V308)))
   (let
    PS
    (cons 'snd (cons (concat 'Parse_ (hd V308)) ()))
    (if
     (empty? (tl V308))
     PS
     (cons
      'append
      (cons PS (cons (shen-default_semantics (tl V308)) ()))))))
  ((cons? V308)
   (cons
    'cons
    (cons (hd V308) (cons (shen-default_semantics (tl V308)) ()))))
  (true (shen-sys-error 'shen-default_semantics))))

(defun
 shen-cc_body
 (V309)
 (cond
  ((and (cons? V309) (and (cons? (tl V309)) (= () (tl (tl V309)))))
   (shen-syntax (hd V309) 'Stream (hd (tl V309))))
  (true (shen-sys-error 'shen-cc_body))))

(defun
 shen-syntax
 (V310 V311 V312)
 (cond
  ((= () V310)
   (cons
    'shen-reassemble
    (cons (cons 'fst (cons V311 ())) (cons (shen-semantics V312) ()))))
  ((cons? V310)
   (if
    (shen-grammar_symbol? (hd V310))
    (shen-recursive_descent V310 V311 V312)
    (if
     (shen-terminal? (hd V310))
     (shen-check_stream V310 V311 V312)
     (if
      (shen-jump_stream? (hd V310))
      (shen-jump_stream V310 V311 V312)
      (if
       (shen-list_stream? (hd V310))
       (shen-list_stream (shen-decons (hd V310)) (tl V310) V311 V312)
       (interror
        "~A is not legal syntax~%"
        (__at__p (hd V310) ())))))))
  (true (shen-sys-error 'shen-syntax))))

(defun
 shen-list_stream?
 (V321)
 (cond ((cons? V321) true) (true false)))

(defun
 shen-decons
 (V322)
 (cond
  ((and
    (cons? V322)
    (and
     (= 'cons (hd V322))
     (and
      (cons? (tl V322))
      (and (cons? (tl (tl V322))) (= () (tl (tl (tl V322))))))))
   (cons (hd (tl V322)) (shen-decons (hd (tl (tl V322))))))
  (true V322)))

(defun
 shen-list_stream
 (V323 V324 V325 V326)
 (let
  Test
  (cons
   'and
   (cons
    (cons 'cons? (cons (cons 'fst (cons V325 ())) ()))
    (cons
     (cons
      'cons?
      (cons (cons 'hd (cons (cons 'fst (cons V325 ())) ())) ()))
     ())))
  (let
   Action
   (cons
    'shen-snd-or-fail
    (cons
     (shen-syntax
      V323
      (cons
       'shen-reassemble
       (cons
        (cons 'hd (cons (cons 'fst (cons V325 ())) ()))
        (cons (cons 'snd (cons V325 ())) ())))
      (cons
       'shen-leave!
       (cons
        (shen-syntax
         V324
         (cons
          'shen-reassemble
          (cons
           (cons 'tl (cons (cons 'fst (cons V325 ())) ()))
           (cons (cons 'snd (cons V325 ())) ())))
         V326)
        ())))
     ()))
   (let
    Else
    (cons 'fail ())
    (cons 'if (cons Test (cons Action (cons Else ()))))))))

(defun
 shen-snd-or-fail
 (V333)
 (cond ((tuple? V333) (snd V333)) (true (fail))))

(defun
 shen-grammar_symbol?
 (V334)
 (and
  (symbol? V334)
  (let
   Cs
   (explode V334)
   (and (= (hd Cs) "<") (= (hd (reverse Cs)) ">")))))

(defun
 shen-recursive_descent
 (V335 V336 V337)
 (cond
  ((cons? V335)
   (let
    Test
    (cons (hd V335) (cons V336 ()))
    (let
     Action
     (shen-syntax (tl V335) (concat 'Parse_ (hd V335)) V337)
     (let
      Else
      (cons 'fail ())
      (cons
       'let
       (cons
        (concat 'Parse_ (hd V335))
        (cons
         Test
         (cons
          (cons
           'if
           (cons
            (cons
             'not
             (cons
              (cons
               '=
               (cons
                (cons 'fail ())
                (cons (concat 'Parse_ (hd V335)) ())))
              ()))
            (cons Action (cons Else ()))))
          ()))))))))
  (true (shen-sys-error 'shen-recursive_descent))))

(defun
 shen-terminal?
 (V346)
 (cond ((cons? V346) false) ((= '-*- V346) false) (true true)))

(defun
 shen-jump_stream?
 (V351)
 (cond ((= '-*- V351) true) (true false)))

(defun
 shen-check_stream
 (V352 V353 V354)
 (cond
  ((cons? V352)
   (let
    Test
    (cons
     'and
     (cons
      (cons 'cons? (cons (cons 'fst (cons V353 ())) ()))
      (cons
       (cons
        '=
        (cons
         (hd V352)
         (cons (cons 'hd (cons (cons 'fst (cons V353 ())) ())) ())))
       ())))
    (let
     Action
     (shen-syntax
      (tl V352)
      (cons
       'shen-reassemble
       (cons
        (cons 'tl (cons (cons 'fst (cons V353 ())) ()))
        (cons (cons 'snd (cons V353 ())) ())))
      V354)
     (let
      Else
      (cons 'fail ())
      (cons 'if (cons Test (cons Action (cons Else ()))))))))
  (true (shen-sys-error 'shen-check_stream))))

(defun
 shen-reassemble
 (V356 V357)
 (cond ((= V357 (fail)) V357) (true (__at__p V356 V357))))

(defun
 shen-jump_stream
 (V358 V359 V360)
 (cond
  ((cons? V358)
   (let
    Test
    (cons 'cons? (cons (cons 'fst (cons V359 ())) ()))
    (let
     Action
     (shen-syntax
      (tl V358)
      (cons
       'shen-reassemble
       (cons
        (cons 'tl (cons (cons 'fst (cons V359 ())) ()))
        (cons (cons 'snd (cons V359 ())) ())))
      V360)
     (let
      Else
      (cons 'fail ())
      (cons 'if (cons Test (cons Action (cons Else ()))))))))
  (true (shen-sys-error 'shen-jump_stream))))

(defun
 shen-semantics
 (V361)
 (cond
  ((and
    (cons? V361)
    (and
     (= 'shen-leave! (hd V361))
     (and (cons? (tl V361)) (= () (tl (tl V361))))))
   (hd (tl V361)))
  ((= () V361) ())
  ((shen-grammar_symbol? V361)
   (cons 'snd (cons (concat 'Parse_ V361) ())))
  ((= '-o- V361) (cons 'snd (cons 'Stream ())))
  ((= '-*- V361) (cons 'hd (cons (cons 'fst (cons 'Stream ())) ())))
  ((= '-s- V361) (cons 'fst (cons 'Stream ())))
  ((cons? V361) (map (lambda V362 (shen-semantics V362)) V361))
  (true V361)))

(defun fail () 'fail!)

(clojure.core/comment "klambda/types.kl")

(defun
 declare
 (V1654 V1655)
 (let
  Record
  (set 'shen-*signedfuncs* (adjoin V1654 (value 'shen-*signedfuncs*)))
  (let
   Variancy
   (trap-error (shen-variancy-test V1654 V1655) (lambda E 'shen-skip))
   (let
    Type
    (shen-rcons_form (shen-normalise-type V1655))
    (let
     F*
     (concat 'shen-type-signature-of- V1654)
     (let
      Parameters
      (shen-parameters 1)
      (let
       Clause
       (cons
        (cons F* (cons 'X ()))
        (cons
         (intern ":-")
         (cons (cons (cons 'unify! (cons 'X (cons Type ()))) ()) ())))
       (let
        AUM_instruction
        (shen-aum Clause Parameters)
        (let
         Code
         (shen-aum_to_shen AUM_instruction)
         (let
          ShenDef
          (cons
           'define
           (cons
            F*
            (append
             Parameters
             (append
              (cons 'ProcessN (cons 'Continuation ()))
              (cons '-> (cons Code ()))))))
          (let Eval (eval-without-macros ShenDef) V1654)))))))))))

(defun
 shen-normalise-type
 (V766)
 (fix (lambda X (shen-normalise-type-help X)) V766))

(defun
 shen-normalise-type-help
 (V767)
 (cond
  ((cons? V767)
   (shen-normalise-X
    (map (lambda X (shen-normalise-type-help X)) V767)))
  (true (shen-normalise-X V767))))

(defun
 shen-normalise-X
 (V768)
 (let
  Val
  (assoc V768 (value 'shen-*synonyms*))
  (if (empty? Val) V768 (tl Val))))

(defun
 shen-variancy-test
 (V1656 V1657)
 (let
  TypeF
  (shen-typecheck V1656 'B)
  (let
   Check
   (if
    (= 'symbol TypeF)
    'shen-skip
    (if
     (shen-variant? TypeF V1657)
     'shen-skip
     (intoutput
      "warning: changing the type of ~A may create errors~%"
      (__at__p V1656 ()))))
   'shen-skip)))

(defun
 shen-variant?
 (V1666 V1667)
 (cond
  ((= V1667 V1666) true)
  ((and (cons? V1666) (and (cons? V1667) (= (hd V1667) (hd V1666))))
   (recur (tl V1666) (tl V1667)))
  ((and
    (cons? V1666)
    (and
     (cons? V1667)
     (and (shen-pvar? (hd V1666)) (variable? (hd V1667)))))
   (recur
    (subst 'shen-a (hd V1666) (tl V1666))
    (subst 'shen-a (hd V1667) (tl V1667))))
  ((and
    (cons? V1666)
    (and (cons? (hd V1666)) (and (cons? V1667) (cons? (hd V1667)))))
   (recur
    (append (hd V1666) (tl V1666))
    (append (hd V1667) (tl V1667))))
  (true false)))

(declare 'absvector? (cons 'A (cons '--> (cons 'boolean ()))))

(declare
 'and
 (cons
  'boolean
  (cons
   '-->
   (cons (cons 'boolean (cons '--> (cons 'boolean ()))) ()))))

(declare
 'append
 (cons
  (cons 'list (cons 'A ()))
  (cons
   '-->
   (cons
    (cons
     (cons 'list (cons 'A ()))
     (cons '--> (cons (cons 'list (cons 'A ())) ())))
    ()))))

(declare
 'apply
 (cons
  (cons 'A (cons '--> (cons 'B ())))
  (cons '--> (cons (cons 'A (cons '--> (cons 'B ()))) ()))))

(declare 'arity (cons 'A (cons '--> (cons 'number ()))))

(declare
 'assoc
 (cons
  'A
  (cons
   '-->
   (cons
    (cons
     (cons 'list (cons (cons 'list (cons 'A ())) ()))
     (cons '--> (cons (cons 'list (cons 'A ())) ())))
    ()))))

(declare 'boolean? (cons 'A (cons '--> (cons 'boolean ()))))

(declare 'bound? (cons 'symbol (cons '--> (cons 'boolean ()))))

(declare 'cd (cons 'string (cons '--> (cons 'string ()))))

(declare
 'close
 (cons
  (cons 'stream (cons 'A ()))
  (cons '--> (cons (cons 'list (cons 'B ())) ()))))

(declare
 'cn
 (cons
  'string
  (cons '--> (cons (cons 'string (cons '--> (cons 'string ()))) ()))))

(declare
 'concat
 (cons
  'symbol
  (cons '--> (cons (cons 'symbol (cons '--> (cons 'symbol ()))) ()))))

(declare 'cons? (cons 'A (cons '--> (cons 'boolean ()))))

(declare
 'destroy
 (cons
  (cons 'A (cons '--> (cons 'B ())))
  (cons '--> (cons (cons 'A (cons '--> (cons 'B ()))) ()))))

(declare
 'difference
 (cons
  (cons 'list (cons 'A ()))
  (cons
   '-->
   (cons
    (cons
     (cons 'list (cons 'A ()))
     (cons '--> (cons (cons 'list (cons 'A ())) ())))
    ()))))

(declare
 'do
 (cons 'A (cons '--> (cons (cons 'B (cons '--> (cons 'B ()))) ()))))

(declare
 'dump
 (cons
  'string
  (cons '--> (cons (cons 'string (cons '--> (cons 'string ()))) ()))))

(declare
 'element?
 (cons
  'A
  (cons
   '-->
   (cons
    (cons (cons 'list (cons 'A ())) (cons '--> (cons 'boolean ())))
    ()))))

(declare 'empty? (cons 'A (cons '--> (cons 'boolean ()))))

(declare
 'interror
 (cons
  'string
  (cons '--> (cons (cons 'A (cons '--> (cons 'B ()))) ()))))

(declare
 'error-to-string
 (cons 'exception (cons '--> (cons 'string ()))))

(declare
 'explode
 (cons 'A (cons '--> (cons (cons 'list (cons 'string ())) ()))))

(declare
 'fail-if
 (cons
  (cons 'symbol (cons '--> (cons 'boolean ())))
  (cons '--> (cons (cons 'symbol (cons '--> (cons 'symbol ()))) ()))))

(declare
 'fix
 (cons
  (cons 'A (cons '--> (cons 'A ())))
  (cons '--> (cons (cons 'A (cons '--> (cons 'A ()))) ()))))

(declare
 'format
 (cons
  (cons 'stream (cons 'out ()))
  (cons
   '-->
   (cons
    (cons
     'string
     (cons '--> (cons (cons 'A (cons '--> (cons 'string ()))) ())))
    ()))))

(declare
 'freeze
 (cons 'A (cons '--> (cons (cons 'lazy (cons 'A ())) ()))))

(declare
 'fst
 (cons (cons 'A (cons '* (cons 'B ()))) (cons '--> (cons 'A ()))))

(declare 'gensym (cons 'symbol (cons '--> (cons 'symbol ()))))

(declare
 '<-vector
 (cons
  (cons 'vector (cons 'A ()))
  (cons '--> (cons (cons 'number (cons '--> (cons 'A ()))) ()))))

(declare
 'vector->
 (cons
  (cons 'vector (cons 'A ()))
  (cons
   '-->
   (cons
    (cons
     'number
     (cons
      '-->
      (cons
       (cons 'A (cons '--> (cons (cons 'vector (cons 'A ())) ())))
       ())))
    ()))))

(declare
 'vector
 (cons 'number (cons '--> (cons (cons 'vector (cons 'A ())) ()))))

(declare 'get-time (cons 'symbol (cons '--> (cons 'number ()))))

(declare
 'hash
 (cons
  'A
  (cons '--> (cons (cons 'number (cons '--> (cons 'number ()))) ()))))

(declare
 'head
 (cons (cons 'list (cons 'A ())) (cons '--> (cons 'A ()))))

(declare
 'hdv
 (cons (cons 'vector (cons 'A ())) (cons '--> (cons 'A ()))))

(declare 'hdstr (cons 'string (cons '--> (cons 'string ()))))

(declare
 'if
 (cons
  'boolean
  (cons
   '-->
   (cons
    (cons 'A (cons '--> (cons (cons 'A (cons '--> (cons 'A ()))) ())))
    ()))))

(declare
 'include
 (cons
  (cons 'list (cons 'symbol ()))
  (cons '--> (cons (cons 'list (cons 'symbol ())) ()))))

(declare
 'include-all-but
 (cons
  (cons 'list (cons 'symbol ()))
  (cons '--> (cons (cons 'list (cons 'symbol ())) ()))))

(declare 'inferences (cons 'A (cons '--> (cons 'number ()))))

(declare 'integer? (cons 'A (cons '--> (cons 'boolean ()))))

(declare
 'intersection
 (cons
  (cons 'list (cons 'A ()))
  (cons
   '-->
   (cons
    (cons
     (cons 'list (cons 'A ()))
     (cons '--> (cons (cons 'list (cons 'A ())) ())))
    ()))))

(declare
 'length
 (cons (cons 'list (cons 'A ())) (cons '--> (cons 'number ()))))

(declare
 'limit
 (cons (cons 'vector (cons 'A ())) (cons '--> (cons 'number ()))))

(declare 'load (cons 'string (cons '--> (cons 'symbol ()))))

(declare
 'intmake-string
 (cons
  'string
  (cons '--> (cons (cons 'A (cons '--> (cons 'string ()))) ()))))

(declare 'intern (cons 'string (cons '--> (cons 'symbol ()))))

(declare
 'map
 (cons
  (cons 'A (cons '--> (cons 'B ())))
  (cons
   '-->
   (cons
    (cons
     (cons 'list (cons 'A ()))
     (cons '--> (cons (cons 'list (cons 'B ())) ())))
    ()))))

(declare
 'mapcan
 (cons
  (cons 'A (cons '--> (cons (cons 'list (cons 'B ())) ())))
  (cons
   '-->
   (cons
    (cons
     (cons 'list (cons 'A ()))
     (cons '--> (cons (cons 'list (cons 'B ())) ())))
    ()))))

(declare 'maxinferences (cons 'number (cons '--> (cons 'number ()))))

(declare 'n->string (cons 'number (cons '--> (cons 'string ()))))

(declare 'nl (cons 'number (cons '--> (cons 'number ()))))

(declare 'not (cons 'boolean (cons '--> (cons 'boolean ()))))

(declare
 'nth
 (cons
  'number
  (cons
   '-->
   (cons
    (cons (cons 'list (cons 'A ())) (cons '--> (cons 'A ())))
    ()))))

(declare 'number? (cons 'A (cons '--> (cons 'boolean ()))))

(declare
 'occurrences
 (cons
  'A
  (cons '--> (cons (cons 'B (cons '--> (cons 'number ()))) ()))))

(declare 'occurs-check (cons 'symbol (cons '--> (cons 'boolean ()))))

(declare
 'or
 (cons
  'boolean
  (cons
   '-->
   (cons (cons 'boolean (cons '--> (cons 'boolean ()))) ()))))

(declare
 'intoutput
 (cons
  'string
  (cons '--> (cons (cons 'A (cons '--> (cons 'string ()))) ()))))

(declare
 'pos
 (cons
  'string
  (cons '--> (cons (cons 'number (cons '--> (cons 'string ()))) ()))))

(declare
 'pr
 (cons
  'string
  (cons
   '-->
   (cons
    (cons (cons 'stream (cons 'out ())) (cons '--> (cons 'string ())))
    ()))))

(declare 'print (cons 'A (cons '--> (cons 'A ()))))

(declare
 'profile
 (cons
  (cons 'A (cons '--> (cons 'B ())))
  (cons '--> (cons (cons 'A (cons '--> (cons 'B ()))) ()))))

(declare
 'preclude
 (cons
  (cons 'list (cons 'symbol ()))
  (cons '--> (cons (cons 'list (cons 'symbol ())) ()))))

(declare 'profile-results (cons 'A (cons '--> (cons 'symbol ()))))

(declare
 'preclude-all-but
 (cons
  (cons 'list (cons 'symbol ()))
  (cons '--> (cons (cons 'list (cons 'symbol ())) ()))))

(declare
 'read-byte
 (cons (cons 'stream (cons 'in ())) (cons '--> (cons 'number ()))))

(declare
 'read-file-as-bytelist
 (cons 'string (cons '--> (cons (cons 'list (cons 'number ())) ()))))

(declare
 'read-file-as-string
 (cons 'string (cons '--> (cons 'string ()))))

(declare
 'remove
 (cons
  'A
  (cons
   '-->
   (cons
    (cons
     (cons 'list (cons 'A ()))
     (cons '--> (cons (cons 'list (cons 'A ())) ())))
    ()))))

(declare
 'reverse
 (cons
  (cons 'list (cons 'A ()))
  (cons '--> (cons (cons 'list (cons 'A ())) ()))))

(declare 'simple-error (cons 'string (cons '--> (cons 'A ()))))

(declare
 'snd
 (cons (cons 'A (cons '* (cons 'B ()))) (cons '--> (cons 'B ()))))

(declare 'specialise (cons 'symbol (cons '--> (cons 'symbol ()))))

(declare 'spy (cons 'symbol (cons '--> (cons 'boolean ()))))

(declare 'step (cons 'symbol (cons '--> (cons 'boolean ()))))

(declare
 'stinput
 (cons 'A (cons '--> (cons (cons 'stream (cons 'B ())) ()))))

(declare 'string? (cons 'A (cons '--> (cons 'boolean ()))))

(declare
 'sum
 (cons (cons 'list (cons 'number ())) (cons '--> (cons 'number ()))))

(declare 'str (cons 'A (cons '--> (cons 'string ()))))

(declare 'string->n (cons 'string (cons '--> (cons 'number ()))))

(declare 'symbol? (cons 'A (cons '--> (cons 'boolean ()))))

(declare
 'systemf
 (cons 'symbol (cons '--> (cons (cons 'list (cons 'symbol ())) ()))))

(declare
 'tail
 (cons
  (cons 'list (cons 'A ()))
  (cons '--> (cons (cons 'list (cons 'A ())) ()))))

(declare 'tlstr (cons 'string (cons '--> (cons 'string ()))))

(declare
 'tlv
 (cons
  (cons 'vector (cons 'A ()))
  (cons '--> (cons (cons 'vector (cons 'A ())) ()))))

(declare 'tc (cons 'symbol (cons '--> (cons 'boolean ()))))

(declare 'tc? (cons 'A (cons '--> (cons 'boolean ()))))

(declare
 'thaw
 (cons (cons 'lazy (cons 'A ())) (cons '--> (cons 'A ()))))

(declare 'track (cons 'symbol (cons '--> (cons 'symbol ()))))

(declare
 'trap-error
 (cons
  'A
  (cons
   '-->
   (cons
    (cons
     (cons 'exception (cons '--> (cons 'A ())))
     (cons '--> (cons 'A ())))
    ()))))

(declare 'tuple? (cons 'A (cons '--> (cons 'boolean ()))))

(declare
 'union
 (cons
  (cons 'list (cons 'A ()))
  (cons
   '-->
   (cons
    (cons
     (cons 'list (cons 'A ()))
     (cons '--> (cons (cons 'list (cons 'A ())) ())))
    ()))))

(declare
 'unprofile
 (cons
  (cons 'A (cons '--> (cons 'B ())))
  (cons '--> (cons (cons 'A (cons '--> (cons 'B ()))) ()))))

(declare 'untrack (cons 'symbol (cons '--> (cons 'symbol ()))))

(declare 'unspecialise (cons 'symbol (cons '--> (cons 'symbol ()))))

(declare 'variable? (cons 'A (cons '--> (cons 'boolean ()))))

(declare 'vector? (cons 'A (cons '--> (cons 'boolean ()))))

(declare 'version (cons 'string (cons '--> (cons 'string ()))))

(declare
 'write-to-file
 (cons
  'string
  (cons '--> (cons (cons 'A (cons '--> (cons 'A ()))) ()))))

(declare 'y-or-n? (cons 'string (cons '--> (cons 'boolean ()))))

(declare
 '>
 (cons
  'number
  (cons '--> (cons (cons 'number (cons '--> (cons 'boolean ()))) ()))))

(declare
 '<
 (cons
  'number
  (cons '--> (cons (cons 'number (cons '--> (cons 'boolean ()))) ()))))

(declare
 '>=
 (cons
  'number
  (cons '--> (cons (cons 'number (cons '--> (cons 'boolean ()))) ()))))

(declare
 '<=
 (cons
  'number
  (cons '--> (cons (cons 'number (cons '--> (cons 'boolean ()))) ()))))

(declare
 '=
 (cons
  'A
  (cons '--> (cons (cons 'A (cons '--> (cons 'boolean ()))) ()))))

(declare
 '+
 (cons
  'number
  (cons '--> (cons (cons 'number (cons '--> (cons 'number ()))) ()))))

(declare
 '/
 (cons
  'number
  (cons '--> (cons (cons 'number (cons '--> (cons 'number ()))) ()))))

(declare
 '-
 (cons
  'number
  (cons '--> (cons (cons 'number (cons '--> (cons 'number ()))) ()))))

(declare
 '*
 (cons
  'number
  (cons '--> (cons (cons 'number (cons '--> (cons 'number ()))) ()))))

(declare
 '==
 (cons
  'A
  (cons '--> (cons (cons 'B (cons '--> (cons 'boolean ()))) ()))))

(clojure.core/defn -main [] (shen-shen))

(clojure.core/load "shen/overwrites")

